Not able to access the topics from ROSbot2pro on the laptop

HI all,

I am not able to access the topics from the ROSbot 2 pro to my laptop.

So I do the following on both Laptop and ROSbot

export ROS_DOMAIN_ID=0
export ROS_LOCALHOST_ONLY=0
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp

Note:- ROSbot has ROS2 foxy version and my laptop has ROS2 humble.
But I used the docker to create a humble version on the Rosbot.

Both the devices are connected to same network and are able to ping each other.

Also if I change to another domain id in the ROSbot the topic list is just 2 and I can’t see other topics and then I am able to connect to the laptop with the same domain id. Suppose I start a chatter on the ROSbot I am able to see the topic on the laptop as well.

Kindly help in how to get the full topic list from ROSbot to the laptop.

Thanks!!

Hello @Sarthak_Shirke,

Problem analysis
I don’t quite understand the chatter part, but maybe that won’t be a problem. There are two key places for data transfer:

  1. Docker ↔ robot (or other device where you run Docker).
  2. From robot ↔ laptop.

Check if running chatter works both ways for point 1 and 2.

Suggestions
If the problem occurs between Docker and Robot, the problem is most likely the DDS configuration in Docker. Suggested solution:

  1. Please use the default configuration.
  2. Change DDS (e.g. cyclone/zenoh).

If the problem persists, please create instructions on how to reproduce the problem.

Best regards

Thanks Rafal !

ok the problem is that the docker is running on the robot which has ROS2 humble and I want to send the topic list to my laptop which also has ROS2 humble.

There is no problem between Docker and the robot they work fine as the docker is running on the robot itself.

And DDS I am using is cyclone DDS.

Let me know if there is another solution to this.

Thanking you,
Sarthak

Please create instructions that will allow me to reproduce. Foremost, I would need the compose file that you are launching.

services:
  astra:
    image: husarion/astra:humble
    container_name: astra
    devices:
      - /dev/bus/usb/
    volumes:
      - ./astra-params.yaml:/ros2_ws/install/astra_camera/share/astra_camera/params/astra_mini_params.yaml
    environment:
      - RMW_IMPLEMENTATION
    command: ros2 launch astra_camera astra_mini.launch.py

  rplidar:
    image: husarion/rplidar:humble
    container_name: rplidar
    restart: unless-stopped
    devices:
      - ${LIDAR_SERIAL:?err}:/dev/ttyUSB0
    environment:
      - RMW_IMPLEMENTATION
    command: >
        ros2 launch sllidar_ros2 sllidar_launch.py
        serial_baudrate:=${RPLIDAR_BAUDRATE:-256000}

  microros:
    image: husarion/micro-ros-agent:humble
    container_name: microros
    restart: unless-stopped
    devices:
      - ${SERIAL_PORT:?err}
    environment:
      - RMW_IMPLEMENTATION=rmw_fastrtps_cpp
    command: ros2 run micro_ros_agent micro_ros_agent serial -D $SERIAL_PORT serial -b 576000 # -v6

  rosbot:
    image: husarion/rosbot:humble
    container_name: rosbot
    restart: unless-stopped
    environment:
      - RMW_IMPLEMENTATION
    network_mode: host
    command: ros2 launch rosbot_bringup bringup.launch.py

Here is the compose.yaml

Reproduce instructions:-

  1. docker compose -f compose.yaml up
  2. ctrl+c (I stop everything)
  3. Then start the " husarion@ubuntu:~$ docker start rosbot " and " husarion@ubuntu:~$ docker start microros "
  4. After doing the 3rd step, I do "ros2 topic list " and the result is

husarion@ubuntu:~$ ros2 topic list
/battery
/button/left
/button/right
/camera/color/camera_info
/camera/color/image_raw
/camera/color/image_raw/compressed
/camera/color/image_raw/compressedDepth
/camera/color/image_raw/ffmpeg
/camera/color/image_raw/theora
/camera/depth/camera_info
/camera/depth/color/points
/camera/depth/image_raw
/camera/depth/image_raw/compressed
/camera/depth/image_raw/compressedDepth
/camera/depth/image_raw/ffmpeg
/camera/depth/image_raw/theora
/camera/depth/points
/camera/ir/camera_info
/camera/ir/image_raw
/camera/ir/image_raw/compressed
/camera/ir/image_raw/compressedDepth
/camera/ir/image_raw/ffmpeg
/camera/ir/image_raw/theora
/cmd_ser
/cmd_vel
/diagnostics
/imu_broadcaster/imu
/imu_broadcaster/transition_event
/joint_states
/led/left
/led/right
/odometry/filtered
/parameter_events
/range/fl
/range/fr
/range/rl
/range/rr
/robot_description
/rosbot_base_controller/odom
/rosbot_base_controller/transition_event
/rosout
/scan
/set_pose
/tf
/tf_static

  1. Below is done on laptop and ROSBOT 2 PRO

export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export ROS_LOCALHOST_ONLY=0
export ROS_DOMAIN_ID=0

After doing this I expect to get a list on my laptop but I am not able to.

I am able to ping both devices.

Thanking you,
Sarthak

Thank you for the instruction. Below I prepared some suggestions:

  1. Sometimes there is a problem with communication using CycloneDDS via WiFi. The easiest solution that my help is restarting ros2 daemon stop && ros2 daemon start. For cyclonedds you can read a bit more here.
  2. Your compose is different from the default compose sent in the message above. Please restore the settings and see if it helps.
  3. If you want, you can use a newer, simplified version of compose without a separate service for microros.
x-common-config:
  &common-config
  network_mode: host
  ipc: host
  restart: unless-stopped
  environment:
    - USER
    - ROBOT_NAMESPACE

services:

  rosbot:
    image: husarion/rosbot:humble-0.13.1-20240201
    container_name: rosbot
    <<: *common-config
    devices:
      - ${SERIAL_PORT:-/dev/ttyUSB0}
      - /dev/bus/usb/ # FTDI
    command: >
      ros2 launch rosbot_bringup combined.launch.py
        mecanum:=${MECANUM:-False}
        namespace:=${ROBOT_NAMESPACE:-rosbot}
        serial_port:=${SERIAL_PORT:-/dev/ttyUSB0}
  1. You can also use the latest version wrapped in snap, which has a more user-friendly API.

Thanks for the reply!