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

Add markers to markerarray in c++

asked 2012-05-30 00:14:02 -0600

Fredje gravatar image

Hi all, I am trying to add markers to a markerarray but i am unable to find the line of code that has to be used for this. Ot is probably pretty simple but I am inexperienced with c++ and ros.

Thank you in advance

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
12

answered 2012-05-30 01:18:09 -0600

dornhege gravatar image

MarkerArray ma; ma.markers.push_back(mark)

edit flag offensive delete link more

Comments

1

what is the difference in insert and push_back

MarkerArray ma;

MarkerArray mark;

ma.markers.insert(ma.makers.end(), mark.makers.begin(), mark.markers.end());

vs

ma.markers.push_back(mark);

gnykumar@gmail.com gravatar image gnykumar@gmail.com  ( 2020-04-22 02:12:05 -0600 )edit

I usually work in python, but it might be that push_back can be in loop easier than your insert line, or that push_back is faster. Could also be neither

Hazel-rah gravatar image Hazel-rah  ( 2023-06-08 15:08:18 -0600 )edit
2

answered 2012-05-30 21:30:49 -0600

Fredje gravatar image

Thank you very much, that works.

edit flag offensive delete link more

Comments

This is not where you comment actually.

kk2105 gravatar image kk2105  ( 2020-09-06 05:55:32 -0600 )edit

Question Tools

Stats

Asked: 2012-05-30 00:14:02 -0600

Seen: 7,218 times

Last updated: May 30 '12