tf_display.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 RVIZ_TF_DISPLAY_H
31 #define RVIZ_TF_DISPLAY_H
32 
33 #include <map>
34 #include <set>
35 
36 #include <OgreQuaternion.h>
37 #include <OgreVector3.h>
38 
40 
41 #include "rviz/display.h"
42 
43 namespace Ogre
44 {
45 class SceneNode;
46 }
47 
48 namespace rviz
49 {
50 class Arrow;
51 class Axes;
52 class BoolProperty;
53 class FloatProperty;
54 class MovableText;
55 class QuaternionProperty;
56 class StringProperty;
57 class VectorProperty;
58 
59 class FrameInfo;
62 
64 class TFDisplay: public Display
65 {
66 Q_OBJECT
67 public:
68  TFDisplay();
69  virtual ~TFDisplay();
70 
71  virtual void update(float wall_dt, float ros_dt);
72 
73 protected:
74  // Overrides from Display
75  virtual void onInitialize();
76  virtual void load(const Config& config);
77  virtual void fixedFrameChanged();
78  virtual void reset();
79 
80 private Q_SLOTS:
81  void updateShowAxes();
82  void updateShowArrows();
83  void updateShowNames();
84  void allEnabledChanged();
85 
86 private:
87  void updateFrames();
88  FrameInfo* createFrame(const std::string& frame);
89  void updateFrame(FrameInfo* frame);
90  void deleteFrame(FrameInfo* frame, bool delete_properties);
91 
92  FrameInfo* getFrameInfo(const std::string& frame);
93 
94  void clear();
95 
96  // overrides from Display
97  virtual void onEnable();
98  virtual void onDisable();
99 
100  Ogre::SceneNode* root_node_;
101  Ogre::SceneNode* names_node_;
102  Ogre::SceneNode* arrows_node_;
103  Ogre::SceneNode* axes_node_;
104 
105  typedef std::map<std::string, FrameInfo*> M_FrameInfo;
106  M_FrameInfo frames_;
107 
108  typedef std::map<std::string, bool> M_EnabledState;
110 
112 
119 
121 
124 
126  friend class FrameInfo;
127 };
128 
130 class FrameInfo: public QObject
131 {
132  Q_OBJECT
133  public:
134  FrameInfo( TFDisplay* display );
135 
137  void setEnabled( bool enabled );
138 
139 public Q_SLOTS:
141  void updateVisibilityFromFrame();
142 
144  void updateVisibilityFromSelection();
145 
146 public:
148  std::string name_;
149  std::string parent_;
152  FrameSelectionHandlerPtr selection_handler_;
155  Ogre::SceneNode* name_node_;
156 
158  Ogre::Quaternion arrow_orientation_;
159 
162 
169 
171 };
172 
173 } // end namespace rviz
174 
175 #endif // RVIZ_TF_DISPLAY_H
Property * frames_category_
Definition: tf_display.h:122
FloatProperty * scale_property_
Definition: tf_display.h:120
boost::shared_ptr< FrameSelectionHandler > FrameSelectionHandlerPtr
Definition: tf_display.h:60
bool changing_single_frame_enabled_state_
Definition: tf_display.h:125
std::string name_
Definition: tf_display.h:148
BoolProperty * show_arrows_property_
Definition: tf_display.h:114
Ogre::SceneNode * root_node_
Definition: tf_display.h:100
Ogre::Quaternion arrow_orientation_
Definition: tf_display.h:158
Ogre::SceneNode * names_node_
Definition: tf_display.h:101
StringProperty * parent_property_
Definition: tf_display.h:167
Property * tree_category_
Definition: tf_display.h:123
Ogre::SceneNode * arrows_node_
Definition: tf_display.h:102
Displays a visual representation of the TF hierarchy.
Definition: tf_display.h:64
A single element of a property tree, with a name, value, description, and possibly children...
Definition: property.h:100
float distance_to_parent_
Definition: tf_display.h:157
config
M_EnabledState frame_config_enabled_state_
Definition: tf_display.h:109
ros::Time last_update_
Definition: tf_display.h:160
std::map< std::string, bool > M_EnabledState
Definition: tf_display.h:108
Internal class needed only by TFDisplay.
Definition: tf_display.h:130
Property specialized to enforce floating point max/min.
BoolProperty * show_names_property_
Definition: tf_display.h:113
VectorProperty * rel_position_property_
Definition: tf_display.h:163
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
Configuration data storage class.
Definition: config.h:125
VectorProperty * position_property_
Definition: tf_display.h:165
QuaternionProperty * rel_orientation_property_
Definition: tf_display.h:164
std::map< std::string, FrameInfo * > M_FrameInfo
Definition: tf_display.h:105
CollObjectHandle axes_coll_
Definition: tf_display.h:151
std::string parent_
Definition: tf_display.h:149
BoolProperty * all_enabled_property_
Definition: tf_display.h:118
Ogre::SceneNode * axes_node_
Definition: tf_display.h:103
BoolProperty * enabled_property_
Definition: tf_display.h:168
TFDisplay * display_
Definition: tf_display.h:147
float update_timer_
Definition: tf_display.h:111
Ogre::SceneNode * name_node_
Definition: tf_display.h:155
An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue.
Definition: axes.h:58
FrameSelectionHandlerPtr selection_handler_
Definition: tf_display.h:152
FloatProperty * update_rate_property_
Definition: tf_display.h:116
Property specialized for string values.
MovableText * name_text_
Definition: tf_display.h:154
BoolProperty * show_axes_property_
Definition: tf_display.h:115
Property specialized to provide getter for booleans.
Definition: bool_property.h:38
An arrow consisting of a cylinder and a cone.
Definition: arrow.h:59
Arrow * parent_arrow_
Definition: tf_display.h:153
M_FrameInfo frames_
Definition: tf_display.h:106
Property * tree_property_
Definition: tf_display.h:170
ros::Time last_time_to_fixed_
Definition: tf_display.h:161
FloatProperty * frame_timeout_property_
Definition: tf_display.h:117
QuaternionProperty * orientation_property_
Definition: tf_display.h:166
uint32_t CollObjectHandle
Definition: forwards.h:46


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sat Apr 27 2019 02:33:42