33 namespace vm = visualization_msgs;
34 namespace mnm = marti_nav_msgs;
38 static geometry_msgs::Point
makePoint(
const double x,
const double y)
40 geometry_msgs::Point pt;
50 const mnm::RouteSpeedArray &speeds,
53 m.header.frame_id = route.
header.frame_id;
57 m.type = vm::Marker::LINE_LIST;
58 m.action = vm::Marker::ADD;
59 m.pose.position.x = 0.0;
60 m.pose.position.y = 0.0;
61 m.pose.position.z = 0.0;
62 m.pose.orientation.x = 0.0;
63 m.pose.orientation.y = 0.0;
64 m.pose.orientation.z = 0.0;
65 m.pose.orientation.w = 1.0;
74 m.frame_locked =
false;
76 m.points.reserve(speeds.speeds.size()*2);
78 for (
auto const &speed : speeds.speeds) {
79 mnm::RoutePosition position;
80 position.id = speed.id;
81 position.distance = speed.distance;
90 tf::Vector3 p2 = p1 + scale*speed.speed*v;
92 m.points.push_back(
makePoint(p1.x(), p1.y()));
93 m.points.push_back(
makePoint(p2.x(), p2.y()));
static geometry_msgs::Point makePoint(const double x, const double y)
void markerForRouteSpeeds(visualization_msgs::Marker &marker, const Route &route, const marti_nav_msgs::RouteSpeedArray &speeds, double scale)
const tf::Vector3 & position() const
bool interpolateRoutePosition(RoutePoint &point, const Route &route, const marti_nav_msgs::RoutePosition &position, bool allow_extrapolation)
const tf::Quaternion & orientation() const