Skip to content

Latest commit

 

History

History
129 lines (102 loc) · 3.58 KB

README.md

File metadata and controls

129 lines (102 loc) · 3.58 KB

mep3

Memristor Eurobot Platform based on ROS 2 image

Table of contents

Getting started

# 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.

Webots world simulation

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

ROS 2 platform

Compilaton

  • 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

Running the simulation

  • 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

Navigation 2 stack

To launch simulation with nav2 run:

ros2 launch mep3_bringup simulation_launch.py

Open RViz afterwards using:

ros2 launch mep3_bringup rviz_launch.py

Testing

  • 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

BehaviorTree

To edit strategies you can use Groot:

Terminal shortcuts

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.