SplineVisual.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Software License Agreement (BSD License) *
3  * Copyright (C) 2016 by George Todoran <george.todoran@tuwien.ac.at> *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions *
7  * are met: *
8  * *
9  * 1. Redistributions of source code must retain the above copyright *
10  * notice, this list of conditions and the following disclaimer. *
11  * 2. Redistributions in binary form must reproduce the above copyright *
12  * notice, this list of conditions and the following disclaimer in *
13  * the documentation and/or other materials provided with the *
14  * distribution. *
15  * 3. Neither the name of the copyright holder nor the names of its *
16  * contributors may be used to endorse or promote products derived *
17  * from this software without specific prior written permission. *
18  * *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
23  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY *
29  * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
30  * POSSIBILITY OF SUCH DAMAGE. *
31  ***************************************************************************/
32 
33 #ifndef SPLINE_VISUAL_H
34 #define SPLINE_VISUAL_H
35 
36 #include <tuw_nav_msgs/Spline.h>
38 #include <eigen3/unsupported/Eigen/Splines>
40 
41 namespace Ogre
42 {
43 class Vector3;
44 class Quaternion;
45 }
46 
47 namespace rviz
48 {
49 class Shape;
50 }
51 
52 namespace tuw_nav_rviz_plugin
53 {
54 
55 // Declare the visual class for this display.
57 {
58 public:
59  // Constructor. Creates the visual stuff and puts it into the
60  // scene, but in an unconfigured state.
61  SplineVisual( Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node );
62 
63  // Destructor. Removes the visual stuff from the scene.
64  virtual ~SplineVisual();
65 
66  // Configure the visual to show the data in the message.
67  void setMessage( const tuw_nav_msgs::Spline::ConstPtr& msg );
68 
69  // Set the pose of the coordinate frame the message refers to.
70  // These could be done inside setMessage(), but that would require
71  // calls to FrameManager and error handling inside setMessage(),
72  // which doesn't seem as clean. This way SplineVisual is
73  // only responsible for visualization.
74  void setFramePosition( const Ogre::Vector3& position );
75  void setFrameOrientation( const Ogre::Quaternion& orientation );
76 
77  // Set the color of the visual, which is an user-editable
78  // parameter and therefore don't come from the MarkerDetection message.
79  void setPathColor( Ogre::ColourValue color );
80  void setOrientColor( Ogre::ColourValue color );
81 
82  // Set the shape of the visual, which is an user-editable
83  // parameter and therefore don't come from the MarkerDetection message.
84  void setShape( rviz::Shape::Type shape_type );
85 
86  // Set the scale of the visual, which is an user-editable
87  // parameter and therefore don't come from the MarkerDetection message.
88  void setPathScale( float scale );
89  void setOrientScale( float scale );
90 
91 
92  void setPathPointsNr( int pointsNr );
93  void setOrientPointsNr( int pointsNr );
94 
95 private:
96  // The objects implementing the actual shape
97  std::vector<boost::shared_ptr<rviz::Shape> > splinePtsXY_;
98  std::vector<boost::shared_ptr<rviz::Arrow> > splinePtsTheta_;
99 
101 
102  // A SceneNode whose pose is set to match the coordinate frame of
103  // the Imu message header.
104  Ogre::SceneNode* frame_node_;
105 
106  // The SceneManager, kept here only so the destructor can ask it to
107  // destroy the ``frame_node_``.
108  Ogre::SceneManager* scene_manager_;
109 
110  // The Shape object's color
111  Ogre::ColourValue colorPath_;
112  Ogre::ColourValue colorOrient_;
113 
114  // The Shape object's shape type
116 
117  // The Shape object's scale
118  float scalePath_;
120 
123 };
124 
125 } // end namespace tuw_nav_rviz_plugin
126 
127 #endif // SPLINE_VISUAL_H
TFSIMD_FORCE_INLINE Vector3()
std::vector< boost::shared_ptr< rviz::Arrow > > splinePtsTheta_
Definition: SplineVisual.h:98
boost::shared_ptr< Eigen::Spline3d > spline_
Definition: SplineVisual.h:100
Ogre::SceneManager * scene_manager_
Definition: SplineVisual.h:108
std::vector< boost::shared_ptr< rviz::Shape > > splinePtsXY_
Definition: SplineVisual.h:97


tuw_nav_rviz_plugin
Author(s):
autogenerated on Sun Aug 28 2016 03:53:55