32 #include <OGRE/OgreVector3.h> 33 #include <OGRE/OgreMatrix3.h> 34 #include <OGRE/OgreSceneNode.h> 35 #include <OGRE/OgreSceneManager.h> 62 goals_.resize(msg->robots.size());
64 for (
size_t i = 0; i < msg->robots.size(); i++){
68 if(msg->robots[i].destinations.size() == 0) {
73 const geometry_msgs::Pose &pose = msg->robots[i].destinations.back();
75 Ogre::Vector3 position = Ogre::Vector3 ( pose.position.x, pose.position.y, pose.position.z );
76 Ogre::Quaternion orientation = Ogre::Quaternion ( pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w );
81 Ogre::Quaternion rotation1 = Ogre::Quaternion ( Ogre::Degree( -90 ), Ogre::Vector3::UNIT_Y );
82 Ogre::Quaternion rotation2 = Ogre::Quaternion ( Ogre::Degree( -180 ), Ogre::Vector3::UNIT_X );
83 orientation = rotation2 * rotation1 * orientation;
85 arrow->setPosition( position );
86 arrow->setOrientation( orientation );
104 goal->setScale ( Ogre::Vector3 ( scale, scale, scale ));
112 goal->setColor ( color );;
std::vector< boost::shared_ptr< rviz::Arrow > > goals_
virtual ~RobotGoalsArrayVisual()
Ogre::SceneNode * frame_node_
Ogre::ColourValue color_pose_
void setScalePose(float scale)
Ogre::SceneManager * scene_manager_
void setFrameOrientation(const Ogre::Quaternion &orientation)
void setColorPose(Ogre::ColourValue color)
void setMessage(const tuw_multi_robot_msgs::RobotGoalsArray::ConstPtr &msg)
RobotGoalsArrayVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
void setFramePosition(const Ogre::Vector3 &position)