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

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

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

AG1617 gravatar image

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

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
1

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

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 http://wiki.ros.org/rviz/DisplayTypes... ).

edit flag offensive delete link more

Question Tools

Stats

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

Seen: 3,160 times

Last updated: Apr 08 '14