ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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);