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

Revision history [back]

click to hide/show revision 1
initial version

Ok, I can answer myself.

I discoevered the using such function signature:

void myclass::incomingPoints( const visualization_msgs::MarkerArray &waypoints ) 
{
    goals.reserve( waypoints.markers.size() );    <---- Note the point!!!
    copy( waypoints.markers.begin(), waypoints.markers.end(), back_inserter( goals ) );   <---- Note the point!!!
}

it compiles

And using another signature:

void myclass::incomingPoints( const visualization_msgs::MarkerArray::ConstPtr &waypoints ) 
{
    goals.reserve( waypoints->markers.size() );    <---- Note the arrow
    copy( waypoints->markers.begin(), waypoints->markers.end(), back_inserter( goals ) );   <---- Note the arrow
}

works.

It also depend on the function signature.

Ok, I can answer myself.

I discoevered the using such function signature:

void myclass::incomingPoints( const visualization_msgs::MarkerArray &waypoints ) 
{
    goals.reserve( waypoints.markers.size() );    <---- Note the point!!!
    copy( waypoints.markers.begin(), waypoints.markers.end(), back_inserter( goals ) );   <---- Note the point!!!
}

it compiles

And using another signature:changing the signature to:

void myclass::incomingPoints( const visualization_msgs::MarkerArray::ConstPtr &waypoints ) 
{
    goals.reserve( waypoints->markers.size() );    <---- Note the arrow
    copy( waypoints->markers.begin(), waypoints->markers.end(), back_inserter( goals ) );   <---- Note the arrow
}

even works.

It Function signature and called method must also depend on the function signature.match.