ROSbot 3: Using Docker

Hello,

I am using a RosBot3, which uses the rosbot, husarion-webui, husarion-depthai and husarion-rplidar. So I am trying to run the slam_toolbox package in a docker container, since there seems to be some kind of problem with the package in ROS 2 Jazzy. The compose file is as follows:

services:
  slam-toolbox:
    image: husarion/slam-toolbox:humble
    network_mode: host
    ipc: host
    volumes:
      - ~/ros2_ws/src/tests_pkg/config/slam.yaml:/params.yaml
    environment:
      - DDS_CONFIG
      - RMW_IMPLEMENTATION
    command: >
      ros2 launch slam_toolbox online_sync_launch.py
        slam_params_file:=/slam_params.yaml
        use_sim_time:=${USE_SIM_TIME:-False}

The problem is that there seems to be some kind of problem with the docker container or the snaps, since when I try to get the information about any of the topics from the container the following error arrises:

root@rosbot:/ros2_ws# ros2 topic info /scan -v
Type: sensor_msgs/msg/LaserScan

Publisher count: 1

Traceback (most recent call last):
  File "/opt/ros/humble/bin/ros2", line 33, in <module>
    sys.exit(load_entry_point('ros2cli==0.18.5', 'console_scripts', 'ros2')())
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2cli/cli.py", line 89, in main
    rc = extension.main(parser=parser, args=args)
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2topic/command/topic.py", line 41, in main
    return extension.main(args=args)
  File "/opt/ros/humble/lib/python3.10/site-packages/ros2topic/verb/info.py", line 62, in main
    for info in node.get_publishers_info_by_topic(topic_name):
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1122, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1464, in __request
    response = self.__transport.request(
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1166, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1182, in single_request
    return self.parse_response(resp)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 1348, in parse_response
    p.feed(data)
  File "/usr/lib/python3.10/xmlrpc/client.py", line 451, in feed
    self._parser.Parse(data, False)
  File "../Modules/pyexpat.c", line 416, in StartElement
  File "/usr/lib/python3.10/xmlrpc/client.py", line 689, in start
    raise ResponseError("unknown tag %r" % tag)
xmlrpc.client.ResponseError: ResponseError("unknown tag 'rclpy.type_hash.TypeHash'")

Could you please help me understand what may be the source of the problem?

Thank you very much,
David.

Hello @DavRodFer,

ROS Jazzy is not compatible with Humble, so getting information from Humble ↔ jazzy is possible.

You can also try stopping snap and running the ros driver on Humble or fixing the problem with slam_toolbox on jazzy. I send you a demo to autonomy on humble which also launch slam_toolbox GitHub - husarion/rosbot-autonomy: Autonomous navigation & mapping for ROSbot 2R / 2 PRO.

Regards

Hello @RafalGorecki,

The main problem with running the slam_toolbox on Jazzy is that running the node with the configuration given (adapting the topic names and frames), does not seem to work, as already discused in this topic: https://community.husarion.com/t/slam-toolbox-does-not-subscribe-to-the-scan-topic/1964/8. In case you have any example using slam_toolbox on ROS Jazzy could you please send me the link so I can take a look at it? Since I have not been able to make it work even in a virtual machine with ROS Jazzy.

Regarding using the ros driver on Humble, no humble image for the RosBot 3 is provided in the manual and it does not specify there being such compatibility. So is the RosBot 3 compatible with ROS Humble? Or should I use the ros drivers from a docker container?

Thank you for the help.

I do not recommend reinstalling the system, but you can use dockers that work similarly to VMs. If you base the entire code on Humble, it will also work on RB3, provided that you also upload the firmware from Humble.

I’m just looking at slam_toolbox in jazzy, so please don’t multiply questions and threads.

Hello @RafalGorecki,

Sorry, I created this thread considering that it came from a different problem. Either way, since the problem with the slam_toolbox has been solved I will continue using Jazzy.

Thank you very much and sorry for the inconvenience.

1 Like