PathVisual.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 PATH_VISUAL_H
34 #define PATH_VISUAL_H
35 
36 #include <nav_msgs/Path.h>
39 
40 namespace Ogre
41 {
42 class Vector3;
43 class Quaternion;
44 }
45 
46 namespace rviz
47 {
48 class Shape;
49 }
50 
51 namespace tuw_nav_rviz
52 {
53 
54 // Declare the visual class for this display.
56 {
57 public:
58  // Constructor. Creates the visual stuff and puts it into the
59  // scene, but in an unconfigured state.
60  PathVisual( Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node );
61 
62  // Destructor. Removes the visual stuff from the scene.
63  virtual ~PathVisual();
64 
65  // Configure the visual to show the data in the message.
66  void setMessage( const nav_msgs::Path::ConstPtr& msg );
67 
68  // Set the pose of the coordinate frame the message refers to.
69  // These could be done inside setMessage(), but that would require
70  // calls to FrameManager and error handling inside setMessage(),
71  // which doesn't seem as clean. This way PathVisual is
72  // only responsible for visualization.
73  void setFramePosition( const Ogre::Vector3& position );
74  void setFrameOrientation( const Ogre::Quaternion& orientation );
75 
76  // Set the color of the visual, which is an user-editable
77  // parameter and therefore don't come from the Path message.
78  void setPathColor( Ogre::ColourValue color );
79  void setOrientColor( Ogre::ColourValue color );
80 
81  // Set the shape of the visual, which is an user-editable
82  // parameter and therefore don't come from the Path message.
83  void setShape( rviz::Shape::Type shape_type );
84 
85  // Set the scale of the visual, which is an user-editable
86  // parameter and therefore don't come from the Path message.
87  void setPathScale( float scale );
88  void setOrientScale( float scale );
89 
90  void setOrientDeltaS( double deltaS );
91 
92 private:
93  // The objects implementing the actual shape
94  std::vector<boost::shared_ptr<rviz::Shape> > pathPtsXY_;
95  std::vector<boost::shared_ptr<rviz::Arrow> > pathPtsTheta_;
96 
97  // A SceneNode whose pose is set to match the coordinate frame of
98  // the Imu message header.
99  Ogre::SceneNode* frame_node_;
100 
101  // The SceneManager, kept here only so the destructor can ask it to
102  // destroy the ``frame_node_``.
103  Ogre::SceneManager* scene_manager_;
104 
105  // The Shape object's color
106  Ogre::ColourValue colorPath_;
107  Ogre::ColourValue colorOrient_;
108 
109  // The Shape object's shape type
111 
112  // The Shape object's scale
113  float scalePath_;
115 
117 };
118 
119 } // end namespace tuw_nav_rviz
120 
121 #endif // PATH_VISUAL_H
Ogre::ColourValue colorPath_
Definition: PathVisual.h:106
rviz::Shape::Type shape_type_
Definition: PathVisual.h:110
TFSIMD_FORCE_INLINE Vector3()
Ogre::SceneNode * frame_node_
Definition: PathVisual.h:99
std::vector< boost::shared_ptr< rviz::Shape > > pathPtsXY_
Definition: PathVisual.h:94
std::vector< boost::shared_ptr< rviz::Arrow > > pathPtsTheta_
Definition: PathVisual.h:95
Ogre::ColourValue colorOrient_
Definition: PathVisual.h:107
Ogre::SceneManager * scene_manager_
Definition: PathVisual.h:103


tuw_nav_rviz
Author(s):
autogenerated on Mon Jun 10 2019 15:40:12