40 #include <OgreQuaternion.h>
41 #include <OgreSceneNode.h>
47 Ogre::SceneNode* parent_node)
48 :
MarkerBase(owner, context, parent_node), lines_(nullptr)
60 ROS_ASSERT(new_message->type == visualization_msgs::Marker::LINE_STRIP);
67 Ogre::Vector3 pos, scale;
68 Ogre::Quaternion orient;
69 if (!
transform(new_message, pos, orient, scale))
79 lines_->
setColor(new_message->color.r, new_message->color.g, new_message->color.b,
80 new_message->color.a);
83 if (new_message->points.empty())
91 bool has_per_point_color = new_message->colors.size() == new_message->points.size();
94 std::vector<geometry_msgs::Point>::const_iterator it = new_message->points.begin();
95 std::vector<geometry_msgs::Point>::const_iterator end = new_message->points.end();
96 for (; it != end; ++it, ++i)
98 const geometry_msgs::Point& p = *it;
100 Ogre::Vector3 v(p.x, p.y, p.z);
103 ROS_WARN(
"Marker '%s/%d': invalid point[%zu] (%.2f, %.2f, %.2f)", new_message->ns.c_str(),
104 new_message->id, i, p.x, p.y, p.z);
109 if (has_per_point_color)
111 const std_msgs::ColorRGBA& color = new_message->colors[i];
114 ROS_WARN(
"Marker '%s/%d': invalid color[%zu] (%.2f, %.2f, %.2f, %.2f)", new_message->ns.c_str(),
115 new_message->id, i, color.r, color.g, color.b, color.a);
125 c.r = new_message->color.r;
126 c.g = new_message->color.g;
127 c.b = new_message->color.b;
128 c.a = new_message->color.a;