ObjectDetectionVisual.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Software License Agreement (BSD License) *
3  * Copyright (C) 2017 by Florian Beck <florian.beck@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 OBJECT_DETECTION_VISUAL_H
34 #define OBJECT_DETECTION_VISUAL_H
35 
36 #include <tuw_object_msgs/ObjectDetection.h>
41 #include <ObjectDetection/common.h>
42 #include <boost/format.hpp>
43 
44 namespace Ogre
45 {
46 class Vector3;
47 class Quaternion;
48 class ColorValue;
49 }
50 
51 namespace rviz
52 {
53 class Arrow;
54 class Shape;
55 class Shape;
56 class MovableText;
57 }
58 
59 namespace tuw_object_rviz
60 {
61 
62 // Declare the visual class for this display.
64 {
65 public:
66  // Constructor. Creates the visual stuff and puts it into the
67  // scene, but in an unconfigured state.
68  ObjectDetectionVisual ( Ogre::SceneManager* scene_manager, Ogre::SceneNode* parent_node );
69 
70  // Destructor. Removes the visual stuff from the scene.
71  virtual ~ObjectDetectionVisual();
72 
73  // Configure the visual to show the data in the message.
74  virtual void setMessage ( const tuw_object_msgs::ObjectWithCovariance::ConstPtr& msg );
75 
76  // Set the pose of the coordinate frame the message refers to.
77  // These could be done inside setMessage(), but that would require
78  // calls to FrameManager and error handling inside setMessage(),
79  // which doesn't seem as clean. This way ObjectDetectionVisual is
80  // only responsible for visualization.
81  void setFramePosition ( const Ogre::Vector3& position );
82  void setFrameOrientation ( const Ogre::Quaternion& orientation );
83 
84  //void setTransformPosition ( const Ogre::Vector3& position );
85  //void setTransformOrientation ( const Ogre::Quaternion& orientation );
86 
87  void setTransform ( const Ogre::Vector3& position, const Ogre::Quaternion& orientation );
88 
89  // Set the scale of the visual, which is an user-editable
90  // parameter and therefore don't come from the message.
91  virtual void setScale ( float scale );
92 
93  // Set the color of the visual's Pose, which is an user-editable
94  // parameter and therefore don't come from the message.
95  virtual void setColor ( Ogre::ColourValue color );
96 
97  void setVisiblities ( bool render_covariance, bool render_id, bool render_sensor_type, bool render_pose );
98 
99  virtual void setStyle ( Styles style );
100 
101 private:
102  // The object implementing the actual pose shape
104 
105  // the object implementing the center of the detection
107 
109 
111 
112 protected:
113  // A SceneNode whose pose is set to match the coordinate frame of
114  // the Imu message header.
115  Ogre::SceneNode* frame_node_;
116 
117  // The SceneManager, kept here only so the destructor can ask it to
118  // destroy the ``frame_node_``.
119  Ogre::SceneManager* scene_manager_;
120 
121  // The pose Shape object's scale
122  float scale_;
123 
124  // The pose Shape object's color
125  Ogre::ColourValue color_;
126 
127  // transform
128  Ogre::Matrix4 transform_;
129 };
130 
131 } // end namespace tuw_object_rviz
132 
133 #endif // OBJECT_DETECTION_VISUAL_H
boost::shared_ptr< rviz::Shape > mean_
TFSIMD_FORCE_INLINE Vector3()
boost::shared_ptr< CovarianceVisual > covariance_
boost::shared_ptr< rviz::Arrow > pose_
Styles
Visualization style for an object.
Definition: common.h:40
boost::shared_ptr< TextVisual > detection_id_


tuw_object_rviz
Author(s): Florian Beck
autogenerated on Mon Jun 10 2019 15:40:17