ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To fill that kind of messages, create a geometry_msgs/PoseStamped and then insert it in the vector poses in the nav_msgs/Path message.

Note that in C++, an variable length array is a std::vector.

So it should look like:

nav_msgs::Path path;

geometry_msgs::PoseStamped pose;

pose.header.stamp = ...;
pose.header.frame_id = ...;
pose.pose.position.x = ...;
[...]

path.header.stamp = ...;
path.header.frame_id = ...;
path.poses.push_back(pose);