Copying "visualization_msgs::MarkerArray" as a vector
I'm attemping to copy that message over the topic visualization_msgs::MarkerArray
with a function like this:
void myclass::incomingPoints( const visualization_msgs::MarkerArray &waypoints )
{
goals.reserve( waypoints->markers.size() );
copy( waypoints->markers.begin(), waypoints->markers.end(), back_inserter( goals ) );
}
where:
std::vector<visualization_msgs::Marker> goals;
But trying to compile I get the error that says: .begin(), .size(), and .end() are not defined in the
visualization_msgs::Marker
error: base operand of ‘->’ has non-pointer type ‘const MarkerArray {aka const visualization_msgs::MarkerArray_<std::allocator<void>
}’ goals.reserve( waypoints->markers.size() );
and that's ok, because they are in the class vector defined. But how can I copy that array?
Regards