Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assuming you included the header files correctly and got a working CMakeLists and a nodehandle (nh).

pose_array_pub = nh.advertise<geometry_msgs::PoseArray>("/my_pose_array", 1);

geometry_msgs::PoseArray my_pose_array;
v_subgoals_.header.frame_id = "map"; // or other frame you wish to publish relative to.
std::vector<geometry_msgs::Pose> your_vector;
// push or insert to your vector
my_pose_array.poses = your_vector;

pose_array_pub.publish(my_pose_array);

Assuming you included the header files correctly and got a working CMakeLists and a nodehandle (nh).

pose_array_pub = nh.advertise<geometry_msgs::PoseArray>("/my_pose_array", 1);

geometry_msgs::PoseArray my_pose_array;
v_subgoals_.header.frame_id = "map"; // or other frame you wish to publish relative to.
std::vector<geometry_msgs::Pose> your_vector;
// push or insert to your vector
my_pose_array.poses = your_vector;

pose_array_pub.publish(my_pose_array);

You can otherwise manually push your pose array with e.g. my_pose_array.poses.push_back(my_pose)

Assuming you included the header files correctly and got a working CMakeLists and a nodehandle (nh).

pose_array_pub = nh.advertise<geometry_msgs::PoseArray>("/my_pose_array", 1);

geometry_msgs::PoseArray my_pose_array;
v_subgoals_.header.frame_id my_pose_array.header.frame_id = "map"; // or other frame you wish to publish relative to.
std::vector<geometry_msgs::Pose> your_vector;
// push or insert to your vector
my_pose_array.poses = your_vector;

pose_array_pub.publish(my_pose_array);

You can otherwise manually push your pose array with e.g. my_pose_array.poses.push_back(my_pose)