question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some message types fail to be forwarded by rosbridge_server to subscribed clients

See original GitHub issue

Description Some message types appear to be silently dropped by rosbridge_server (using websocket_launch). In particular, shape_msgs/msg/MeshTriangle (but there may be other similar messages which cause the same issue).

When a MeshTriangle message is published, it can be received by local nodes, but rosbridge client subscribers never receive the message. Additionally, if a message containing a list of MeshTriangle is published, this message may be received by rosbridge clients if the list is empty, but as soon as the list contains data for at least one MeshTriangle the whole message appears to be lost or discarded. (i.e. a shape_msgs/msg/Mesh message can be successfully received by a client if the triangles field is empty, but not if the field contains at least one entry)

  • Library Version: 1.1.1
  • ROS Version: ROS2 Galactic
  • Platform / OS: Ubuntu 20.04.3

For reference, the message definition of MeshTriangle is:

# Definition of a triangle's vertices.

uint32[3] vertex_indices

Steps To Reproduce: MeshTriangle not received by client

# launch rosbridge
ros2 launch rosbridge_server rosbridge_websocket_launch.xml

# publish a MeshTriangle
ros2 topic pub /test/triangle shape_msgs/msg/MeshTriangle "vertex_indices: [1, 2, 3]"

# echo the topic to verify the publisher is sending data
ros2 topic echo /test/triangle

Using the roslibjs simple example page (or any other working rosbridge client), add a subscriber to the triangle topic, load the page and open a browser console:

  var triangle_topic = new ROSLIB.Topic({
	ros: ros,
	name: '/test/triangle',
	messageType: 'shape_msgs/msg/MeshTriangle'
  });
  triangle_topic.subscribe(function(message) {
    console.log('New Triangle: ', message);
  });

Expected Behavior MeshTriangle messages are received on the Javascript side.

Actual Behavior No messages are received on the Javascript side. Additionally, no errors appear to be logged by rosbridge_server.

image

Steps To Reproduce: Mesh not received by client only if a MeshTriangle is present

# launch rosbridge
ros2 launch rosbridge_server rosbridge_websocket_launch.xml

# publish a Mesh containing only one vertex and no triangles
ros2 topic pub /test/mesh shape_msgs/msg/Mesh "{triangles: [], vertices: [{x: 1, y: 2, z: 3}]}"

# echo the topic to verify the publisher is sending data
ros2 topic echo /test/mesh

Using the roslibjs simple example page (or any other working rosbridge client), add a subscriber to the mesh topic, load the page and open a browser console:

  var mesh_topic = new ROSLIB.Topic({
	ros: ros,
	name: '/test/mesh',
	messageType: 'shape_msgs/msg/Mesh'
  });
  mesh_topic.subscribe(function(message) {
    console.log('New Mesh: ', message);
  });

Verify the message is received on the javascript side: New Mesh: Object { triangles: [], vertices: (1) […] }

Now, change the publisher to include one MeshTriangle in the Mesh.triangles field:

ros2 topic pub /test/mesh shape_msgs/msg/Mesh "{triangles: [vertex_indices: [1, 2, 3]], vertices: [{x: 1, y: 2, z: 3}]}"

Expected Behavior Mesh messages are received in both cases.

Actual Behavior Mesh messages are only received if they contain no MeshTriangle data (but additional vertex data is fine).

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
noirbcommented, Jan 31, 2022

@kenji-miyake : Sorry it took me a while to try your fix, but I’m happy to say it looks like it solved my issue 😃

0reactions
kenji-miyakecommented, Jan 10, 2022

Regarding MeshTriangle, I believe fixed in #692.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I run rosbridge on client node? - ROS Answers
the command run on the client is: roslaunch rosbridge_server rosbridge_websocket.launch wich is what is producing that error. As I wrote: it's ...
Read more >
ROS web tutorial part 1 - rosbridge server and roslibjs
This code declares a txt_listener object that will listen to messages on /txt_msg topic and that will accept messages of type String. Then...
Read more >
RobotWebTools - Bountysource
When using a rosbridge_protocol client library ( roslibjs , roslibpy ) to subscribe to a topic that uses a user-defined message type, the...
Read more >
Open Source Q&A Forum - RSS feed - ROS Answers
Hello, I have some Javascript code that uses rosbridge_suite (Hydro debian ... This error is occurring on all message types, not just `rosgraph_msgs/Log`....
Read more >
Source code for pynrp.simulation - Neurorobotics Platform
The full error is below:\n %(msg)s" % {'type': msg['errorType'], ... Simulation status messages will be forwarded to any registered callbacks.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found