mapping pkgs publishes a string in the last bit in the /map topic (map.data[])
Hello All,
This is actually my first question. I am having a trouble with all the mapping pkgs in ROS2 when I echo the topic /map, I always get a string in the last bit of the map.data[], here is what I expect
` header: stamp: sec: 5158 nanosec: 179000000 frame_id: map info: map_load_time: sec: 0 nanosec: 0 resolution: 0.05000000074505806 width: 384 height: 384 origin: position: x: -10.0 y: -10.0 z: 0.0 orientation: x: 0.0 y: 0.0 z: 0.0 w: 1.0 data: - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1 - -1
- '...'
`
I want to subscribe on the /map topic from the the rosbridge_server pkg to build a map on a web page but I always encouter this error
[rosbridge_websocket-1] [ERROR] [1646827887.002034763] [rosbridge_websocket]: Exception calling subscribe callback: a bytes-like object is required, not 'str'**
Here is what I get:
I think it's because of the published string in the map.data[]. Have anybody encountered this error before?
Note: same setup works properly on ros1
Can you add your callback code there too? Maybe there is some bug to fix, it will be easier to analyze
I run the rosbridge first, then I open the continuous.html which can be found at the following https://github.com/RobotWebTools/ros2djs/tree/develop/examples
This seems to be related to this kind of problems: https://stackoverflow.com/questions/3... (especially parts which mention differences between Python2 and Python3 - the latter is used in ROS2 now). Are you using correct version of each package (for ROS2)?
Yes, I'm using the latest version in each pkg.