ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Adding the solution I figured out. I changed the callback function to:
void planCallback(const nav_msgs::Path::ConstPtr& msg) { int i=0; std::vector<geometry_msgs::posestamped> data = msg->poses; for(std::vector<geometry_msgs::posestamped>::const_iterator it= data.begin(); it!= data.end(); ++it) { //gPlan.poses.header.stamp = gPlan.poses[i].header = it->header; gPlan.poses[i].pose = it->pose; i++; } }
and it works.