ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Methods of visualization_msgs/MarkerArray.

asked 2021-03-28 02:18:20 -0500

SurajJadhav gravatar image
  1. Where can I find a complete documentation of visualization_msgs/MarkerArray? I m interested in methods of visualization_msgs/MarkerArray.

  2. Also as it is an array so I assume that it will contain only 1 type of Marker, right?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-03-28 04:21:10 -0500

ct2034 gravatar image

updated 2021-03-28 04:21:49 -0500

  1. You can find the documentation here: As you can see, it is just an array of

  2. They can be of different type, because the different types all use the same class, as you can see from the previous link.

You can also find more info here and here

edit flag offensive delete link more


Thanks ct2034, Thanks for your reply. 1. The sources you shared does not talk about any methods of visualization_msgs/MarkerArray. 2. So, it id clear that the array can contain any type marker.

SurajJadhav gravatar image SurajJadhav  ( 2021-04-09 01:57:26 -0500 )edit

That's probably because they do not have methods. These message types, as all ROS message types, are only containers for data. So you will have to assign values to them directly and then publish them. For example marker.pose.position.x = 99

ct2034 gravatar image ct2034  ( 2021-04-09 02:39:28 -0500 )edit

Will you take a look at line #41 of code given [link text]. ( The code uses append() method. There are many such examples.

SurajJadhav gravatar image SurajJadhav  ( 2021-04-09 03:35:18 -0500 )edit

Okay, sorry. Anything that is defined as an array in the msg file (like Marker[] markers here) will be converted to a std::vector<Marker>in c++ (see for their methods). There are some other specialities about messages that you can find here:

ct2034 gravatar image ct2034  ( 2021-04-09 04:00:51 -0500 )edit

Thanks @ct2034, this is what I needed. It is very useful information and is not provided in the official documentation.

SurajJadhav gravatar image SurajJadhav  ( 2021-04-14 03:09:34 -0500 )edit

cool, happy that it helped. Can you please click the checkbox next to the answer then.

ct2034 gravatar image ct2034  ( 2021-04-14 03:40:14 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2021-03-28 02:18:20 -0500

Seen: 1,353 times

Last updated: Mar 28 '21