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


tuw_spline_rviz_plugin
Author(s):
autogenerated on Mon Aug 1 2016 04:05:16