Go to the documentation of this file.
30 #include <OgreSceneNode.h>
31 #include <OgreSceneManager.h>
32 #include <OgreManualObject.h>
33 #include <OgreBillboardSet.h>
34 #include <OgreMatrix4.h>
53 "Color to draw neighbor links.",
this );
55 "Color to draw merged neighbor links.",
this );
57 "Color to draw global loop closure links.",
this );
59 "Color to draw local loop closure links.",
this );
61 "Color to draw landmark links.",
this );
63 "Color to draw user links.",
this );
65 "Color to draw virtual links.",
this );
68 "Amount of transparency to apply to the path.",
this );
100 if(!(
msg->poses.size() ==
msg->posesId.size()))
102 ROS_ERROR(
"rtabmap_msgs::MapGraph: Error pose ids and poses must have all the same size.");
107 std::map<int, rtabmap::Transform> poses;
108 std::multimap<int, rtabmap::Link> links;
118 ROS_DEBUG(
"Error transforming from frame '%s' to frame '%s'",
msg->header.frame_id.c_str(), qPrintable(
fixed_frame_ ));
126 Ogre::ColourValue color;
127 Ogre::ManualObject* manual_object =
scene_manager_->createManualObject();
128 manual_object->setDynamic(
true );
132 manual_object->estimateVertexCount(links.size() * 2);
133 manual_object->begin(
"BaseWhiteNoLighting", Ogre::RenderOperation::OT_LINE_LIST );
134 for(std::multimap<int, rtabmap::Link>::iterator
iter=links.begin();
iter!=links.end(); ++
iter)
136 std::map<int, rtabmap::Transform>::iterator poseIterFrom = poses.find(
iter->second.from());
137 std::map<int, rtabmap::Transform>::iterator poseIterTo = poses.find(
iter->second.to());
138 if(poseIterFrom != poses.end() && poseIterTo != poses.end())
170 pos =
transform * Ogre::Vector3( poseIterFrom->second.x(), poseIterFrom->second.y(), poseIterFrom->second.z() );
171 manual_object->position(
pos.x,
pos.y,
pos.z );
172 manual_object->colour( color );
173 pos =
transform * Ogre::Vector3( poseIterTo->second.x(), poseIterTo->second.y(), poseIterTo->second.z() );
174 manual_object->position(
pos.x,
pos.y,
pos.z );
175 manual_object->colour( color );
179 manual_object->end();
ColorProperty * color_global_property_
ColorProperty * color_neighbor_property_
virtual void reset()
Overridden from Display.
void mapGraphFromROS(const rtabmap_msgs::MapGraph &msg, std::map< int, rtabmap::Transform > &poses, std::multimap< int, rtabmap::Link > &links, rtabmap::Transform &mapToOdom)
ColorProperty * color_user_property_
ColorProperty * color_local_property_
Displays the graph of rtabmap::MapGraph message.
virtual ~MapGraphDisplay()
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
ColorProperty * color_neighbor_merged_property_
virtual float getFloat() const
virtual void onInitialize()
Overridden from Display.
Ogre::SceneNode * scene_node_
GLM_FUNC_DECL detail::tmat4x4< T, P > orientation(detail::tvec3< T, P > const &Normal, detail::tvec3< T, P > const &Up)
Ogre::SceneManager * scene_manager_
virtual FrameManager * getFrameManager() const=0
std::vector< Ogre::ManualObject * > manual_objects_
void onInitialize() override
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
DisplayContext * context_
iterator iter(handle obj)
Point3 position(const NavState &X, OptionalJacobian< 3, 9 > H)
ColorProperty * color_virtual_property_
EIGEN_DONT_INLINE void transform(const Quaternion< Scalar > &t, Data &data)
ColorProperty * color_landmark_property_
void processMessage(const rtabmap_msgs::MapGraph::ConstPtr &msg)
Overridden from MessageFilterDisplay.
Ogre::ColourValue getOgreColor() const
FloatProperty * alpha_property_