32 #include <OGRE/OgreVector3.h> 33 #include <OGRE/OgreSceneNode.h> 34 #include <OGRE/OgreSceneManager.h> 35 #include <OGRE/OgreEntity.h> 60 _markers.resize(msg->markers.size());
62 for (
size_t i = 0; i < msg->markers.size(); i++) {
63 double p_x = msg->markers[i].pose.position.x;
64 double p_y = msg->markers[i].pose.position.y;
65 double p_z = msg->markers[i].pose.position.z;
66 double o_x = msg->markers[i].pose.orientation.x;
67 double o_y = msg->markers[i].pose.orientation.y;
68 double o_z = msg->markers[i].pose.orientation.z;
69 double o_w = msg->markers[i].pose.orientation.w;
72 if (msg->markers[i].ids.size() > 0)
73 id = msg->markers[i].ids[0];
76 _markers[i]->setPosition(Ogre::Vector3(p_x, p_y, p_z));
77 _markers[i]->setOrientation(Ogre::Quaternion(o_w, o_x, o_y, o_z));
95 for (
size_t i = 0; i <
_markers.size(); i++) {
103 for (
size_t i = 0; i <
_markers.size(); i++) {
104 _markers[i]->setShowMarker(showMarker);
111 for (
size_t i = 0; i <
_markers.size(); i++) {
112 _markers[i]->setShowLabel(showLabel);
119 for (
size_t i = 0; i <
_markers.size(); i++) {
125 for (
size_t i = 0; i <
_markers.size(); i++) {
126 _markers[i]->setScale(Ogre::Vector3(scale, scale, scale));
std::vector< boost::shared_ptr< Marker > > _markers
Ogre::SceneNode * frame_node_
void setFrameOrientation(const Ogre::Quaternion &orientation)
void setScale(float scale)
void setShowLabel(bool showLabel)
MarkerDetectionVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
virtual ~MarkerDetectionVisual()
void setMessage(const marker_msgs::MarkerDetection::ConstPtr &msg)
void setColorLabel(Ogre::ColourValue color)
void setShowAxes(bool showAxes)
Ogre::ColourValue _colorLabel
void setShowMarker(bool showMarker)
Ogre::SceneManager * scene_manager_
void setFramePosition(const Ogre::Vector3 &position)