Some message types fail to be forwarded by rosbridge_server to subscribed clients
See original GitHub issueDescription
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
.
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).
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
@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 😃
Regarding
MeshTriangle
, I believe fixed in #692.