30 #ifndef TRAJECTORY_TRACKER_MSGS_CONVERTER_H 31 #define TRAJECTORY_TRACKER_MSGS_CONVERTER_H 33 #include <geometry_msgs/PoseStamped.h> 34 #include <geometry_msgs/Vector3.h> 35 #include <nav_msgs/Path.h> 36 #include <trajectory_tracker_msgs/PathWithVelocity.h> 41 const nav_msgs::Path& src,
44 PathWithVelocity dest;
45 dest.header = src.header;
47 dest.poses.reserve(src.poses.size());
48 for (
const geometry_msgs::PoseStamped& p : src.poses)
50 PoseStampedWithVelocity pv;
53 pv.linear_velocity.x = vel;
54 dest.poses.push_back(pv);
59 const nav_msgs::Path& src,
60 const geometry_msgs::Vector3& vel)
62 PathWithVelocity dest;
63 dest.header = src.header;
65 dest.poses.reserve(src.poses.size());
66 for (
const geometry_msgs::PoseStamped& p : src.poses)
68 PoseStampedWithVelocity pv;
71 pv.linear_velocity = vel;
72 dest.poses.push_back(pv);
78 #endif // TRAJECTORY_TRACKER_MSGS_CONVERTER_H
PathWithVelocity toPathWithVelocity(const nav_msgs::Path &src, const double vel)