0
$\begingroup$

Rosanswers logo

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


Originally posted by Fredje on ROS Answers with karma: 51 on 2012-05-30

Post score: 3

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

MarkerArray ma; ma.markers.push_back(mark)


Originally posted by dornhege with karma: 31395 on 2012-05-30

This answer was ACCEPTED on the original site

Post score: 12


Original comments

Comment by [email protected] on 2020-04-22:
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);

Comment by Hazel-rah on 2023-06-08:
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

$\endgroup$
0
$\begingroup$

Rosanswers logo

Thank you very much, that works.


Originally posted by Fredje with karma: 51 on 2012-05-30

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by kk2105 on 2020-09-06:
This is not where you comment actually.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.