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

How to find the number of Markers in a Marker Array?

asked 2013-07-23 06:37:44 -0500

AG1617 gravatar image

updated 2014-04-20 14:09:30 -0500

ngrennan gravatar image

Hi Everyone,

I'm trying to write a simple program that extracts the heights from all the markers in a MarkerArray message. However, I am having a lot of trouble doing this.

This is how I get the cartesian information: msg->markers[i].pose.position.z

I read somewhere that this might work, but so far no luck: msg->markers.size()

Any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-04-08 15:44:56 -0500

atp gravatar image

msg->markers.size() gives you the number of markers contained in the message.

To find or set the height, have a look at the scale fields of the marker message (see also ).

edit flag offensive delete link more

Question Tools


Asked: 2013-07-23 06:37:44 -0500

Seen: 3,100 times

Last updated: Apr 08 '14