Robotics StackExchange | Archived questions

rosbridge_server and ros2djs on ros2 galactic not working? [rosbridge_websocket]: Exception calling subscribe callback: a bytes-like object is required, not 'str'

Hello,

I am trying to run this ros2djs sample to display a map in on a html page. However when the open the html page rosbridge_server says

[ERROR] [1648211787.790774020] [rosbridge_websocket]: Exception calling subscribe callback: a bytes-like object is required, not 'str'

System Setup:

Expected Behaviour

Steps to reproduce

  1. Launch the turtlebot simulation via ros2 launch nav2_bringup tb3_simulation_launch.py
  2. Launch the rosbridgeserver via `ros2 run rosbridgeserver rosbridge_websocket`
  3. Open the map.html file (the tutorial link above has a html file source that i saved on my local PC)
  4. The minute I open the map.html file the error text above pops up in the terminal and i end up with a blank box on the map.html file

Can someone please point me in the right direction as to what is causing this?

Thanks

Asked by rjrs23 on 2022-03-25 07:58:21 UTC

Comments

Please, any advance on this??

Asked by robpin on 2022-08-26 07:33:38 UTC

do you have any solution for this issue?

Asked by vela-io on 2023-02-10 10:52:53 UTC

Answers

1- Install ros noetic along the ros galactic 2- install the rosbridge in your ros1 workspace 3- install and run the ros1_ros2_bridge

This is actually a quick fix till they update the ros2_rosbridge_server pkg

Asked by youssef desouky on 2022-04-17 23:39:11 UTC

Comments

I face the same problem in ROS galactic but I can solve it by editing the ros2d.js in the part of OccupancyGridClient class and ImageMapClient. In the ImageMapClient, change the topic from /map_metadata to /map and change the messageType to nav_msgs/OccupancyGrid (in ROS2, I cannot find /map_metada topic like in ROS1). In the OccupancyGridClient, I only comment line of the parameter : compression:png. After finished these steps, it can work well with the rosbridge_server

Asked by Phuwanat on 2023-05-20 09:33:10 UTC

Comments