[Solved] ROS_DOMAIN_ID not being respected

I have six rosbot 2rs, and I am trying to use the docker system.
With the new image it claims that ROS_DOMAIN_ID is now supported.
When I modified the compose.yaml file and set the ROS_DOMAIN_ID only the topics from microros were respected. rplidar and rosbot did not show up at all.
(without setting the ROS_DOMAIN_ID everything works - topic-wise).
I do not understand docker enough to figure out how to explore the files and it is impossible (from what I can tell) to remap from ros2 launch, without modifying the launch files.

Is there a way I set the default namespace so each robot is different?

Sorry I got that backwards. Everything is showing up correctly EXCEPT for microros.

Okay, on the terminal in the robot I have ROS_DOMAIN_ID Set to 1

husarion@husarion:~$ printenv ROS_DOMAIN_ID
1
husarion@husarion:~$

On a linux machine (same network) I have the ROS_DOMAIN_ID unset

student@ros2class:~$ printenv ROS_DOMAIN_ID
student@ros2class:~$

My compose.yaml I have ROS_DOMAIN_ID set to 1 along with this statement in microros

  • XRCE_DOMAIN_ID_OVERRIDE=${ROS_DOMAIN_ID:-}

When I run the docker files:
The shell on the robot (with ROS_DOMAIN_ID=1) will give the following when I use ros2 topic list:

husarion@husarion:~$ ros2 topic list
/cmd_vel
/diagnostics
/imu_broadcaster/imu
/imu_broadcaster/transition_event
/joint_states
/odometry/filtered
/parameter_events
/robot_description
/rosbot_base_controller/odom
/rosbot_base_controller/transition_event
/rosout
/scan
/set_pose
/tf
/tf_static

When I use ros2 topic list on the linux box that does not have ROS_DOMAIN_ID set I get this:

student@ros2class:~$ ros2 topic list
/battery
/button/left
/button/right
/cmd_ser
/led/left
/led/right
/parameter_events
/range/fl
/range/fr
/range/rl
/range/rr
/rosout

So microros is treating ROS_DOMAIN_ID as unset, while rplidar and rosbot are respecting the ROS_DOMAIN_ID.

Please help.

Sincerely
BT

Hello @Brad_Towle

It is very possible that the problem is the wrong version of the firmware you are uploading. Unfortunately, a typo has crept into our documentation in the Quick Start Guide that tells the user to play a firmware version that may not yet support the ROS_DOMAIN_ID variable.

:warning: Make sure all docker containers are stopped on ROSbot before typing the command below! :warning:

The following command should solve your problem:

docker stop rosbot microros || true && docker run \
--rm -it --privileged \
husarion/rosbot:humble-0.6.1-20230712 \
flash-firmware.py /root/firmware.bin

Interestingly, if you are using a new system image, flashing the firmware using Utility script should also solve your problem: ~/flash_firmware.sh


Best regards
Jan Brzyk

I will try that again.
I was running the 7.18 version that you posted. But maybe I entered the wrong command to flash.

Thank you!
I must have been flashing the wrong version.
(I updated to the new micro-sd card version).
It is working now.

Thank you!

1 Like

Iā€™m glad the problem has been resolved!


Best regards
Jan Brzyk