33 #include <OGRE/OgreVector3.h> 34 #include <OGRE/OgreSceneNode.h> 35 #include <OGRE/OgreSceneManager.h> 38 #include <eigen3/unsupported/Eigen/Splines> 84 static double timeOld_;
85 if ( timeOld_ == msg->header.stamp.toSec() ) {
88 timeOld_ = msg->header.stamp.toSec();
95 for (
size_t i = 0; i < msg->segments.size(); i++ ) {
97 const geometry_msgs::Pose &p0 = segment.start;
98 const geometry_msgs::Pose &pc = segment.center;
99 const geometry_msgs::Pose &p1 = segment.end;
105 startShape->setPosition ( Ogre::Vector3 ( p0.position.x, p0.position.y, p0.position.z ) );
106 startShape->setOrientation ( Ogre::Quaternion ( p0.orientation.x, p0.orientation.y, p0.orientation.z, p0.orientation.w ) );
114 endShape->setPosition ( Ogre::Vector3 ( p1.position.x, p1.position.y, p1.position.z ) );
115 endShape->setOrientation ( Ogre::Quaternion ( p1.orientation.x, p1.orientation.y, p1.orientation.z, p1.orientation.w ) );
122 centerShape->setPosition ( Ogre::Vector3 ( pc.position.x, pc.position.y, pc.position.z ) );
123 centerShape->setOrientation ( Ogre::Quaternion ( pc.orientation.x, pc.orientation.y, pc.orientation.z, pc.orientation.w ) );
130 line->setPoints ( Ogre::Vector3 ( p0.position.x, p0.position.y, p0.position.z ), Ogre::Vector3 ( p1.position.x, p1.position.y, p1.position.z ) );
131 line->setScale ( Ogre::Vector3 ( 1, 1, 1 ) );
135 double angle_resolution = M_PI/45.;
136 std::vector<geometry_msgs::PosePtr> poses;
140 Ogre::Vector3 v0( p0.position.x, p0.position.y, p0.position.z);
142 for (
int i = 1; i < poses.size(); i++) {
145 v1 = Ogre::Vector3 ( poses[i]->position.x, poses[i]->position.y, poses[i]->position.z);
147 line->setPoints ( v0, v1 );
148 line->setScale ( Ogre::Vector3 ( 1, 1, 1 ) );
153 v1 = Ogre::Vector3 ( p1.position.x, p1.position.y, p1.position.z);
155 line->setPoints ( v0, v1 );
156 line->setScale ( Ogre::Vector3 ( 1, 1, 1 ) );
214 Ogre::Vector3 posOld = pnt->getPosition();
215 Ogre::Quaternion orientOld = pnt->getOrientation();
218 pnt->setPosition ( posOld );
219 pnt->setOrientation ( orientOld );
227 Ogre::Vector3 posOld = pnt->getPosition();
228 Ogre::Quaternion orientOld = pnt->getOrientation();
231 pnt->setPosition ( posOld );
232 pnt->setOrientation ( orientOld );
240 Ogre::Vector3 posOld = pnt->getPosition();
241 Ogre::Quaternion orientOld = pnt->getOrientation();
244 pnt->setPosition ( posOld );
245 pnt->setOrientation ( orientOld );
static const unsigned int ARC
void setShowStartPoints(bool visible)
virtual ~RouteSegmentsVisual()
Ogre::ColourValue color_center_point_
void setMessage(const tuw_nav_msgs::RouteSegments::ConstPtr &msg)
Ogre::ColourValue color_start_point_
std::vector< boost::shared_ptr< rviz::Line > > arcs_
RouteSegmentsVisual(Ogre::SceneManager *scene_manager, Ogre::SceneNode *parent_node)
std::vector< boost::shared_ptr< rviz::Line > > lines_
void setEndPointScale(float scale)
void setCenterPointColor(Ogre::ColourValue color)
void setShowLines(bool visible)
static const unsigned int LINE
std::vector< boost::shared_ptr< rviz::Shape > > endPts_
void setShowArcs(bool visible)
void setFrameOrientation(const Ogre::Quaternion &orientation)
rviz::Shape::Type shape_center_point_
Ogre::ColourValue color_end_point_
Ogre::SceneNode * frame_node_
void setFramePosition(const Ogre::Vector3 &position)
void setCenterPointScale(float scale)
float scale_center_point_
double sample_equal_angle(std::vector< geometry_msgs::PosePtr > &poses, double angle, double distance_offset) const
void setShowEndPoints(bool visible)
void setStartPointColor(Ogre::ColourValue color)
Ogre::ColourValue color_arcs_
Ogre::SceneManager * scene_manager_
rviz::Shape::Type shape_start_point_
void setArcColor(Ogre::ColourValue color)
void setEndPointShape(rviz::Shape::Type shape_type)
void setCenterPointShape(rviz::Shape::Type shape_type)
Ogre::ColourValue color_lines_
void setShowCenterPoints(bool visible)
std::vector< boost::shared_ptr< rviz::Shape > > centerPts_
std::vector< boost::shared_ptr< rviz::Shape > > startPts_
void setEndPointColor(Ogre::ColourValue color)
void setLineColor(Ogre::ColourValue color)
void setStartPointScale(float scale)
rviz::Shape::Type shape_end_point_
void setStartPointShape(rviz::Shape::Type shape_type)