This is a ROS2 Humble package for interfacing with an ASTRO robot.
Make sure you are running Ubuntu 22.04.
ROS2 Humble Installation
ROS2 Tutorials Creating a workspace
-
Example, creating a workspace named astro_ws:
mkdir -p ~/astro_ws/src cd ~/astro_ws/src
-
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 ros2-humble https://github.com/AndrijaAdamovic/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.
Bash (default):
echo "source astro_ws/install/setup.bash" >> ~/.bashrc source ~/.bashrc
If using Zsh:
echo "source astro_ws/install/setup.zsh" >> ~/.zshrc source ~/.zshrc
-
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
(If using zsh) First method (suggested) (zsh):
echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> ~/.zshrc source ~/.zshrc
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 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.
If using bash (default):
echo "export ROS_DOMAIN_ID=number of your ASTRO robot" >> ~/.bashrc source ~/.bashrc
If using Zsh:
echo "export ROS_DOMAIN_ID=number of your ASTRO robot" >> ~/.zshrc source ~/.zshrc
-
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