Memristor Eurobot Platform based on ROS 2
# Make sure you have ROS 2 Galactic installed.
# https://docs.ros.org/en/galactic/Installation/Ubuntu-Install-Debians.html
# Source ROS 2
source /opt/ros/galactic/local_setup.bash
# Create a workspace
mkdir -p ~/galactic_ws/src
cd ~/galactic_ws
git clone [email protected]:memristor/mep3.git src/mep3
# Install dependencies
rosdep update
rosdep install --from-paths src --ignore-src
# Build the packages
colcon build
# Source this workspace
source install/local_setup.bash
Please check alternative installation methods here.
- Open
mep3_simulation/webots_data/worlds/eurobot_2022.wbt
in Webots
webots ~/ros2_ws/src/mep3/mep3_simulation/webots_data/worlds/eurobot_2022.wbt
- Stop simulation and set time to
00:00:00
- Save changes
- Commit all changes except for
Viewpoint
- Change working directory to
~/ros2_ws
- Install dependencies if there are changes in
package.xml
files
rosdep install --from-paths src --ignore-src
- Build files (and rebuild on every modification):
colcon build
source ./install/local_setup.bash
- Run the simulation without the behavior tree:
ros2 launch mep3_bringup simulation_launch.py bt:=false
- Control the robot from another terminal window
source /opt/ros/galactic/local_setup.bash
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r cmd_vel:=big/cmd_vel
- Run the simulation with the behavior tree:
ros2 launch mep3_bringup simulation_launch.py
To launch simulation with nav2
run:
ros2 launch mep3_bringup simulation_launch.py
Open RViz afterwards using:
ros2 launch mep3_bringup rviz_launch.py
- Change working directory to
~/ros2_ws
- Run the following command:
source /opt/ros/galactic/local_setup.bash colcon test --event-handlers console_cohesion+ --return-code-on-test-failure
To edit strategies you can use Groot:
- Install Groot (you can use the AppImage version)
- Edit strategies XML files in mep3_behavior_tree/assets/strategies directory
- Run planner for
first_strategy.xml
with:ros2 run mep3_behavior_tree mep3_behavior_tree first_strategy --ros-args -r __ns:=/big
We use custom terminal shortcuts to provide better development environment ergonomics.
# Enable terminal shortcuts temporarily
source ~/ros2_ws/src/mep3/docker/config/shortcuts.sh
# Enable terminal shortcuts permanently
echo "source ~/ros2_ws/src/mep3/docker/config/shortcuts.sh" >> ~/.bashrc
source ~/.bashrc
After enabling shortcuts, run command h
in the terminal to get familiarized with them.