This is a ROS2 Humble meta-package for interfacing with an ASTRO robot.
Commands that may need to be run
sudo apt updatesudo apt install ros-humble-rmw-cyclonedds-cppWARNING
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg-
Example, creating a workspace named astro_ws:
mkdir -p ~/astro_ws/src cd ~/astro_ws/src
astro_serial_cpp package is not included in the build by default. If you want to build it remove the COLCON_IGNORE file from astro_serial_cpp folder.
-
Clone ASTRO package from GitHub
Make sure you are inside astro_ws/src folder (generally in src folder of your workspace).
cd ~/astro_ws/src git clone -b humble https://github.com/CRTA-Lab/ASTRO.git
-
Installing dependencies
Make sure you are now in your main workspace folder, in this example ~/astro_ws/
Make sure you have rosdep set-up.cd ~/astro_ws/ rosdep install --from-paths src -y --ignore-src
-
Building ASTRO package
Make sure you are still in your main workspace folder, in this example ~/astro_ws/
cd ~/astro_ws/ colcon build --symlink-install
-
Configuring package environment
If your ws is not named astro_ws, replace astro_ws with your ws name in the following commands.
echo "source ~/astro_ws/install/setup.bash" >> ~/.bashrc source ~/.bashrc
-
Chaning RMW Implementation to Cyclone DDS
For better data transfer between your PC and the ASTRO robot change RMW implementation to Cyclone DDS \
First method (suggested) (bash - default):
echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.bashrc source ~/.bashrc
Second method
If you don't want to have Cyclone DDS as your main RMW implementation, but just for one terminalexport RMW_IMPLEMENTATION=rmw_cyclonedds_cpp -
Configuring ROS_DOMAIN_ID
First, make sure ASTRO Robot is switched on, and that you are on the same network as the robot.
Now, to work with an ASTRO robot, look up it's number, that number is the ROS_DOMAIN_ID. \
E.G. For an ASTRO robot with a number 3:
export ROS_DOMAIN_ID=3However, this will work for only one terminal, in every other terminal we must run the command above to have access to the robot. If you don't want to run the export command in every new terminal, do this.
echo "export ROS_DOMAIN_ID=number of your ASTRO robot" >> ~/.bashrc source ~/.bashrc
-
Starting Robot State Publisher
Now, with RMW implementation changed, and corresponding ROS_DOMAIN_ID exported, and your workspace sourced, execute:
ros2 launch astro rsp.launch.py
This will start Robot State Publisher for an ASTRO Robot.
You can now interface with ASTRO Robot via ROS2.
Enjoy!
The rsp.launch.py launch file has a few launch parameters, to list them run:
ros2 launch astro rsp.launch.py --show-argsExample with a running ASTRO robot and run_rviz:=true:
ros2 launch astro rsp.launch.py run_rviz:=true