ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

You'd want a custom message type which looks something like this:

# My custom cluster message
geometry_msgs/Point centroid
geometry_msgs/Point min
geometry_msgs/Point max

Each value in this custom message is a structure of 3 floats so you can access the individual values very easily like this:

myCustomMessage.centroid.x

If you want to view this messages in RVIZ, I'd recommend also generating a line list marker message showing the geometry.

Hope this helps.

You'd want a custom message type which looks something like this:

# My custom cluster message
geometry_msgs/Point centroid
geometry_msgs/Point min
geometry_msgs/Point max

Each value in this custom message is a structure of 3 floats so you can access the individual values very easily like this:

myCustomMessage.centroid.x

If you want to view this messages in RVIZ, I'd recommend also generating a line list marker message showing the geometry.

Hope this helps.

UPDATE:

You can't append arbitrary values to the marker messages, but there is still a less elegant way of doing it. The marker message would define the visuals as an array of 3D points which define the lines. If the order of these lines is always the same then index in this list of the min/centroid/max x/y/z values will always be the same. If you had a static list of indices you could lookup the values you needed directly from the points vector of the marker message. This way you wouldn't need a custom message and would only need to publish a single message each time not two.