33 #include <OGRE/OgreVector3.h> 34 #include <OGRE/OgreSceneNode.h> 35 #include <OGRE/OgreSceneManager.h> 38 #include <eigen3/unsupported/Eigen/Splines> 69 static double timeOld_;
70 if( timeOld_ == msg->header.stamp.toSec() ){
return; }
71 timeOld_ = msg->header.stamp.toSec();
74 for(
size_t i = 0; i <
pathPtsXY_.size(); ++i) {
75 double p_x = msg->poses[i].pose.position.x;
76 double p_y = msg->poses[i].pose.position.y;
77 double p_z = msg->poses[i].pose.position.z;
82 Ogre::Quaternion rotation;
83 rotation.x = msg->poses[i].pose.orientation.x;
84 rotation.y = msg->poses[i].pose.orientation.y;
85 rotation.z = msg->poses[i].pose.orientation.z;
86 rotation.w = msg->poses[i].pose.orientation.w;
87 Ogre::Quaternion rotation2 = Ogre::Quaternion ( Ogre::Radian( -Ogre::Math::PI/2.), Ogre::Vector3::UNIT_Y );
91 pathPtsXY_[i]->setPosition ( Ogre::Vector3 ( p_x, p_y, p_z ) );
92 pathPtsXY_[i]->setOrientation ( rotation *rotation2 );
108 for(
size_t i = 1; i <
pathPtsXY_.size(); ++i) {
156 Ogre::Vector3 posOld = splineXYi->getPosition();
157 Ogre::Quaternion orientOld = splineXYi->getOrientation();
160 splineXYi->setPosition ( posOld );
161 splineXYi->setOrientation ( orientOld );
191 for(
size_t i = 1; i <
pathPtsXY_.size(); ++i) {
void setFramePosition(const Ogre::Vector3 &position)
PathVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
void setMessage(const nav_msgs::Path::ConstPtr &msg)
void setShape(rviz::Shape::Type shape_type)
Ogre::ColourValue colorPath_
void setOrientDeltaS(double deltaS)
rviz::Shape::Type shape_type_
void setOrientScale(float scale)
Ogre::SceneNode * frame_node_
std::vector< boost::shared_ptr< rviz::Shape > > pathPtsXY_
std::vector< boost::shared_ptr< rviz::Arrow > > pathPtsTheta_
void setPathColor(Ogre::ColourValue color)
void setFrameOrientation(const Ogre::Quaternion &orientation)
Ogre::ColourValue colorOrient_
void setOrientColor(Ogre::ColourValue color)
Ogre::SceneManager * scene_manager_
void setPathScale(float scale)