Ask Your Question
0

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
1

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: http://docs.ros.org/en/noetic/api/vis... As you can see, it is just an array of http://docs.ros.org/en/noetic/api/vis...

  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 https://wiki.ros.org/rviz/DisplayType... and here https://wiki.ros.org/rviz/Tutorials/M...

edit flag offensive delete link more

Comments

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]. (http://docs.ros.org/en/fuerte/api/rvi...) The code uses append() method. There are many such examples.

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

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 https://en.cppreference.com/w/cpp/con... for their methods). There are some other specialities about messages that you can find here: http://wiki.ros.org/action/show/msg?a...

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

2 followers

Stats

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

Seen: 118 times

Last updated: Mar 28