ROSbot 2 PRO: ROS2 Foxy firmware issues running the bot manually

Hello,
I have Rosbot 2 Pro with noetic and foxy images.
I have connected it via my personal laptop and want to run the robot manually. First i tried with noetic distribution.
–Noetic–
$ docker compose pull
$ docker stop rosbot ros-master || true && docker run --rm -it --privileged husarion/rosbot:noetic \ flash-firmware.py /root/firmware_diff.bin
$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Result: I was able to run the bot manually.

–ROS2 Foxy–
$ source /opt/ros/foxy/setup.bash ///comment > to change distribution to foxy instead of noetic
$ docker compose pull
$ docker stop rosbot microros || true && docker run --rm -it --privileged husarion/rosbot:humble /flash-firmware.
py /root/firmware.bin
$ ros2 teleop_twist_keyboard teleop_twist_keyboard.py

Result: Unable to run through keyboard.

The firmware I am flashing has “husarion/rosbot:humble” , I could not find a similar command for ros2 foxy. I am not sure what needs to be done to run the robot. Please help

Hello @QuackerCoder,

To change the ROS distribution, for ROSbot, it usually takes two steps.

  1. Uploading the firmware from a given distribution
  2. Running the ROS driver from the distribution.

I miss the information about running the driver in your comment.

So the correct instructions were:

  1. Create compose for your ROS distribution: noetic, humble
  2. Flash firmware for your ROS distribution:
    docker stop rosbot microros
    docker run --rm -it --privileged husarion/rosbot: /flash-firmware.
    py /root/firmware.bin
  3. Run ROS driver (docker compose -f your-compose.yaml up)
  4. Teleop: If you want to communicate via ROS, with a different distribution than the one you have installed natively on your system, you can enter docker and install the necessary tools there. Command to execute: docker exec -it bash

If you have any further questions, feel free to reach out.

I am currently using ROSbot 2.0 pro. It has Ubuntu 20.4, so I am unable to install ROS2 Humble as it is not supported. Can you please clarify ? Is there any link for com[ose file of ROS2 Foxy ?

Hello @QuackerCoder,

We use compose.yaml with images based on ROS2 Humble. Since the Foxy distribution is compatible in communication with Humble, you can build nodes based on the Foxy distribution.

If you want to maintain distribution consistency, you can also use a concept called Developing inside a Container

I was able to flash the firmware as per your instructions.
$ docker compose up -d rosbot microros
[+] Running 4/4
⠿ Volume “husarion_dummy_volume_fastdds” Created
⠿ Volume “husarion_dummy_volume_cyclonedds” Created
⠿ Container microros Started
⠿ Container rosbot Started
$ ros2 topic list
/joint_states
/parameter_events
/robot_description
/rosout
/tf
/tf_static
$ ros2 run teleop_twist_keyboard teleop_twist_keyboard
Doesn’t run using keyboard.

Am I missing something, also in the youtube video there are many rostopic lists and I only have 6.

It’s look like the communication with hardware do not initialized succesfully.

  1. Please flash-firmware from the same image, which is specified in compose. If you use this compose.yaml, the command should look like this:
docker run --rm -it --privileged husarion/husarion/rosbot:humble-0.6.1-20230712: /flash-firmware.py /root/firmware.bin
  1. Make sure above command finish cleanly. You should see a status bar from 0 to 100%.

  2. If you have installed rosbot snap service, you need to disable it. You can establish only one communication with hardwer at the same time.

  3. Run docker compose up rosbot microros without -d flag to see logs. You can send it to me.

  4. When did the robot last work? What has happened since then?

These are all the ideas I have at the moment.

Please find below logs
husarion@husarion:~$ docker compose up rosbot microros
[+] Running 2/0
⠿ Container microros Created 0.0s
⠿ Container rosbot Created 0.0s
Attaching to microros, rosbot
microros | [1734715191.386211] error | TermiosAgentLinux.cpp | init | open device error | device: /dev/ttyS4, errno: 13. Please re-run with superuser privileges.
microros | Error while starting serial agent!
microros exited with code 0
microros | Error while starting serial agent!
microros | [1734715192.121609] error | TermiosAgentLinux.cpp | init | open device error | device: /dev/ttyS4, errno: 13. Please re-run with superuser privileges.
microros exited with code 0
microros | [1734715193.017153] error | TermiosAgentLinux.cpp | init | open device error | device: /dev/ttyS4, errno: 13. Please re-run with superuser privileges.
microros | Error while starting serial agent!
microros exited with code 0
microros | [1734715194.075603] error | TermiosAgentLinux.cpp | init | open device error | device: /dev/ttyS4, errno: 13. Please re-run with superuser privileges.
microros | Error while starting serial agent!
microros exited with code 0
rosbot | [INFO] [launch]: All log files can be found below /home/husarion/.ros/log/2024-12-20-17-19-54-412415-husarion-1
rosbot | [INFO] [launch]: Default logging verbosity is set to INFO
microros | Error while starting serial agent!
microros | [1734715195.543763] error | TermiosAgentLinux.cpp | init | open device error | device: /dev/ttyS4, errno: 13. Please re-run with superuser privileges.
microros exited with code 0
rosbot | [INFO] [ros2_control_node-1]: process started with pid [69]
rosbot | [INFO] [robot_state_publisher-2]: process started with pid [71]
rosbot | [INFO] [spawner-3]: process started with pid [73]
rosbot | [INFO] [ekf_node-4]: process started with pid [75]
rosbot | [robot_state_publisher-2] [INFO] [1734715197.580713989] [robot_state_publisher]: got segment base_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.586433701] [robot_state_publisher]: got segment body_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.589405793] [robot_state_publisher]: got segment camera_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592209050] [robot_state_publisher]: got segment cover_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592296824] [robot_state_publisher]: got segment depth
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592349636] [robot_state_publisher]: got segment fl_range
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592401897] [robot_state_publisher]: got segment fl_wheel_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592455821] [robot_state_publisher]: got segment fr_range
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592507783] [robot_state_publisher]: got segment fr_wheel_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592559570] [robot_state_publisher]: got segment imu_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592609957] [robot_state_publisher]: got segment laser
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592662643] [robot_state_publisher]: got segment orbbec_astra_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592714555] [robot_state_publisher]: got segment rl_range
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592766704] [robot_state_publisher]: got segment rl_wheel_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592817391] [robot_state_publisher]: got segment rr_range
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592869178] [robot_state_publisher]: got segment rr_wheel_link
rosbot | [robot_state_publisher-2] [INFO] [1734715197.592921252] [robot_state_publisher]: got segment slamtec_rplidar_a2_link
rosbot | [ros2_control_node-1] [INFO] [1734715197.743539675] [resource_manager]: Loading hardware ‘imu’
rosbot | [ros2_control_node-1] [INFO] [1734715197.755923260] [resource_manager]: Initialize hardware ‘imu’
rosbot | [ros2_control_node-1] [INFO] [1734715197.756089157] [RosbotImuSensor]: Initializing
rosbot | [ros2_control_node-1] [INFO] [1734715197.794895923] [resource_manager]: Successful initialization of hardware ‘imu’
rosbot | [ros2_control_node-1] [INFO] [1734715197.795314804] [resource_manager]: Loading hardware ‘wheels’
rosbot | [ros2_control_node-1] [INFO] [1734715197.796316489] [resource_manager]: Initialize hardware ‘wheels’
rosbot | [ros2_control_node-1] [INFO] [1734715197.796399563] [RosbotSystem]: Initializing
rosbot | [ros2_control_node-1] [INFO] [1734715197.796710383] [RosbotSystem]: Joint ‘fl_wheel_joint’ found
rosbot | [ros2_control_node-1] [INFO] [1734715197.798841563] [RosbotSystem]: Joint ‘fr_wheel_joint’ found
rosbot | [ros2_control_node-1] [INFO] [1734715197.798993785] [RosbotSystem]: Joint ‘rl_wheel_joint’ found
rosbot | [ros2_control_node-1] [INFO] [1734715197.799045147] [RosbotSystem]: Joint ‘rr_wheel_joint’ found
rosbot | [ros2_control_node-1] [INFO] [1734715197.834593839] [resource_manager]: Successful initialization of hardware ‘wheels’
rosbot | [ros2_control_node-1] [INFO] [1734715197.835237041] [resource_manager]: ‘configure’ hardware ‘imu’
rosbot | [ros2_control_node-1] [INFO] [1734715197.835316677] [RosbotImuSensor]: Configuring
rosbot | [ros2_control_node-1] [INFO] [1734715197.835357052] [resource_manager]: Successful ‘configure’ of hardware ‘imu’
rosbot | [ros2_control_node-1] [INFO] [1734715197.835397964] [resource_manager]: ‘activate’ hardware ‘imu’
rosbot | [ros2_control_node-1] [INFO] [1734715197.835433763] [RosbotImuSensor]: Activating
microros | [1734715197.842924] error | TermiosAgentLinux.cpp | init | open device error | device: /dev/ttyS4, errno: 13. Please re-run with superuser privileges.
microros | Error while starting serial agent!
rosbot | [ros2_control_node-1] [WARN] [1734715197.851632077] [RosbotImuSensor]: Feedback message from imu wasn’t received yet
microros exited with code 0
rosbot | [ros2_control_node-1] [WARN] [1734715198.352008951] [RosbotImuSensor]: Feedback message from imu wasn’t received yet
rosbot | [ros2_control_node-1] [WARN] [1734715198.852370705] [RosbotImuSensor]: Feedback message from imu wasn’t received yet
rosbot | [ros2_control_node-1] [WARN] [1734715199.352678648] [RosbotImuSensor]: Feedback message from imu wasn’t received yet
rosbot | [ros2_control_node-1] [WARN] [1734715199.853032757] [RosbotImuSensor]: Feedback message from imu wasn’t received yet
rosbot | [ros2_control_node-1] [WARN] [1734715200.353341368] [RosbotImuSensor]: Feedback message from imu wasn’t received yet
rosbot | [ros2_control_node-1] [WARN] [1734715200.853681433] [RosbotImuSensor]: Feedback message from imu wasn’t received yet
rosbot | [ros2_control_node-1] [WARN] [1734715201.353986999] [RosbotImuSensor]: Feedback message from imu wasn’t received yet
rosbot | [spawner-3] [INFO] [1734715201.527250577] [spawner_joint_state_broadcaster]: Waiting for ‘/controller_manager’ services to be available
microros | [1734715201.698426] error | TermiosAgentLinux.cpp | init | open device error | device: /dev/ttyS4, errno: 13. Please re-run with superuser privileges.

I do not know why, microros does not have access to the port /dev/ttyS4. You can try:

  1. Extend permissions using /dev/ttyS4.
  2. Make suer the port is added to the container, you can try set privileged in compose to true.
  3. OS reinstalation.