ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
It works, apart that there's a compilation error on the callback. If you write:
std::cout << "I received: " << msg->points.back().x << std::endl;
instead, you get 49. Not sure if that's what you want.
2 | No.2 Revision |
It works, apart that there's a compilation error on the callback. If you write:
std::cout << "I received: " << msg->points.back().x << std::endl;
instead, you get 49. Not sure if that's what you want.
UPDATE All is fine here; it just turns out that the x coordinate is constant for every point; the snake-like movement only requires to change y and z. Just print the hole first and last points and you will notice all is fine:
std::cout << "I received: " << msg->points.front() << " ..." << msg->points.back() << std::endl;
Btw, you see the whole point because geometric_msgs/Point objects (and all ROS messages) are serialized as yaml, and so shown on std::cout.