LABORATORY L1.5

/DENALI/ROS2

Install ROS 2

Install ROS 2 on your computer with the official instruction..

Setup the L1.5 configuration

The ROS 2 communication in the laboratory is based on the FASTDDS ROS Middleware Implementation with the discovery server running on the Denali. Download the fastdds configuration file to the .ros directory.

wget denali.kcir.pwr.edu.pl/~jdelicat/files/fastdds.xml -O ~/.ros/fastdds.xml

Export the ROS 2 variables and set the FastDDS configuration.

export ROS_DISTRO=humble

If you are using ROS 2 Foxy replace humble with foxy but the humble version is recommended.

export ROS_PACKAGE_PATH=/opt/ros/$ROS_DISTRO/share

export ROS_ROOT=/opt/ros/$ROS_DISTRO/share/ros

export ROS_DISCOVERY_SERVER=10.104.16.240:11811

export RMW_IMPLEMENTATION=rmw_fastrtps_cpp

export FASTRTPS_DEFAULT_PROFILES_FILE=/home/$USERNAME/.ros/fastdds.xml

source /opt/ros/$ROS_DISTRO/setup.bash

It is highly recommended to add this all commands to the ~/.bashrc file.
Restart the ROS 2 daemon:

ros2 daemon stop

ros2 daemon start

Test ROS 2 L1.5 setup

Now if any Pioneer is turned on you should see the /pioneer topics e. g.: ros2 topic list /diagnostics

/parameter_events

/pioneer2/battery_recharge_state

/pioneer2/battery_state_of_charge

/pioneer2/clutch

/pioneer2/cmd_vel

/pioneer2/joint_states

/pioneer2/laser_status

/pioneer2/odom/wheels

/pioneer2/robot_description

/pioneer2/robot_info

/pioneer2/scan

/pioneer2/user_stop

/pioneers/master_stop

/pioneers/restrictions

/rosout

/tf

/tf_static

L1.5 User safety plugin

To drive Pioneers in the laboratory the user has to select and unlock the robot in the safety system.

Create the workspace.

sudo apt install python3-colcon-common-extensions

mkdir -p ~/safety_ws/src

cd ~/safety_ws

git clone https://denali.kcir.pwr.edu.pl/git/L1.5/ros2aria.git -b humble src/ros2aria

git clone https://denali.kcir.pwr.edu.pl/git/L1.5/safety_user_plugin.git -b ros2-development src/safety_user_plugin

Build the workspace.

source /opt/ros/$ROS_DISTRO/setup.bash

colcon build --packages-select safety_user_plugin ros2aria_msgs

source install/setup.bash

ros2 run safety_user_plugin user_plugin_node

After that the user safety system should appear. Now it is possible to select the robot. Make sure that the teacher enabled the robots.