Tutorial 8: Move Robots with ROS2 Actions

Tutorial 8

The code used in this tutorial is provided as a reference for how to use ROS2 actions to command robots. MoveIt is not used in this tutorial. The main goal of this tutorial is to show how to use ROS2 actions to move both robots simultaneously. Competitors interested in using ROS2 actions to command robots are encouraged to use this code as a starting point. Competitors are encouraged to learn more about ROS2 actions by reading the ROS2 actions documentation.

Package Structure

Updates and additions that are specific to Tutorial 8 are highlighted in the tree below.

ariac_tutorials
├── CMakeLists.txt
├── package.xml
├── config
│   └── sensors.yaml
├── launch
│   └── robot_commander.launch.py
├── ariac_tutorials
│   ├── __init__.py
│   ├── utils.py
|   ├── robot_commander.py
│   └── competition_interface.py
├── src
│   └── robot_commander.cpp
└── scripts
    ├── tutorial_1.py
    ├── tutorial_2.py
    ├── tutorial_3.py
    ├── tutorial_4.py
    ├── tutorial_5.py
    ├── tutorial_6.py
    ├── tutorial_7.py
    └── tutorial_8.py

Run the Executable

  • In terminal 1, run the following commands:

    cd ~/ariac_ws
    colcon build
    . install/setup.bash
    ros2 run ariac_tutorials tutorial_8.py
    

    The node will wait until the competition is ready.

  • In terminal 2, run the following commands:

    cd ~/ariac_ws
    . install/setup.bash
    ros2 launch ariac_gazebo ariac.launch.py trial_name:=tutorial competitor_pkg:=ariac_tutorials
    

Outputs

Both robots simultaneously move to their respective home positions.