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;
63 
65 class TFDisplay : public Display
66 {
67  Q_OBJECT
68 public:
69  TFDisplay();
70  ~TFDisplay() override;
71 
72  void update(float wall_dt, float ros_dt) override;
73 
74 protected:
75  // Overrides from Display
76  void onInitialize() override;
77  void load(const Config& config) override;
78  void fixedFrameChanged() override;
79  void reset() override;
80 
81 private Q_SLOTS:
82  void updateShowAxes();
83  void updateShowArrows();
84  void updateShowNames();
85  void allEnabledChanged();
86 
87 private:
88  typedef std::map<std::string, FrameInfo*> M_FrameInfo;
89 
90  void updateFrames();
91  FrameInfo* createFrame(const std::string& frame);
92  void updateFrame(FrameInfo* frame);
93  M_FrameInfo::iterator deleteFrame(M_FrameInfo::iterator it, bool delete_properties);
94 
95  FrameInfo* getFrameInfo(const std::string& frame);
96 
97  void clear();
98 
99  // overrides from Display
100  void onEnable() override;
101  void onDisable() override;
102 
103  Ogre::SceneNode* root_node_;
104  Ogre::SceneNode* names_node_;
105  Ogre::SceneNode* arrows_node_;
106  Ogre::SceneNode* axes_node_;
107 
108  M_FrameInfo frames_;
109 
110  typedef std::map<std::string, bool> M_EnabledState;
112 
114 
121 
127 
129  friend class FrameInfo;
130 };
131 
133 class FrameInfo : public QObject
134 {
135  Q_OBJECT
136 public:
137  FrameInfo(TFDisplay* display);
138 
140  void setEnabled(bool enabled);
141 
142 public Q_SLOTS:
145  void updateVisibilityFromFrame();
146 
149  void updateVisibilityFromSelection();
150 
151 public:
153  std::string name_;
154  std::string parent_;
157  FrameSelectionHandlerPtr selection_handler_;
160  Ogre::SceneNode* name_node_;
161 
163  Ogre::Quaternion arrow_orientation_;
164 
167 
174 
176 };
177 
178 } // end namespace rviz
179 
180 #endif // RVIZ_TF_DISPLAY_H
Property * frames_category_
Definition: tf_display.h:125
FloatProperty * scale_property_
Definition: tf_display.h:122
boost::shared_ptr< FrameSelectionHandler > FrameSelectionHandlerPtr
Definition: tf_display.h:60
bool changing_single_frame_enabled_state_
Definition: tf_display.h:128
std::string name_
Definition: tf_display.h:153
BoolProperty * show_arrows_property_
Definition: tf_display.h:116
Ogre::SceneNode * root_node_
Definition: tf_display.h:103
Ogre::Quaternion arrow_orientation_
Definition: tf_display.h:163
Ogre::SceneNode * names_node_
Definition: tf_display.h:104
StringProperty * parent_property_
Definition: tf_display.h:172
Property * tree_category_
Definition: tf_display.h:126
Ogre::SceneNode * arrows_node_
Definition: tf_display.h:105
Displays a visual representation of the TF hierarchy.
Definition: tf_display.h:65
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:162
config
M_EnabledState frame_config_enabled_state_
Definition: tf_display.h:111
ros::Time last_update_
Definition: tf_display.h:165
std::map< std::string, bool > M_EnabledState
Definition: tf_display.h:110
Internal class needed only by TFDisplay.
Definition: tf_display.h:133
Property specialized to enforce floating point max/min.
BoolProperty * show_names_property_
Definition: tf_display.h:115
VectorProperty * rel_position_property_
Definition: tf_display.h:168
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
Configuration data storage class.
Definition: config.h:124
VectorProperty * position_property_
Definition: tf_display.h:170
QuaternionProperty * rel_orientation_property_
Definition: tf_display.h:169
std::map< std::string, FrameInfo * > M_FrameInfo
Definition: tf_display.h:88
CollObjectHandle axes_coll_
Definition: tf_display.h:156
std::string parent_
Definition: tf_display.h:154
BoolProperty * all_enabled_property_
Definition: tf_display.h:120
Ogre::SceneNode * axes_node_
Definition: tf_display.h:106
BoolProperty * enabled_property_
Definition: tf_display.h:173
RegexFilterProperty * filter_whitelist_property_
Definition: tf_display.h:123
TFDisplay * display_
Definition: tf_display.h:152
float update_timer_
Definition: tf_display.h:113
Ogre::SceneNode * name_node_
Definition: tf_display.h:160
An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue.
Definition: axes.h:59
FrameSelectionHandlerPtr selection_handler_
Definition: tf_display.h:157
RegexFilterProperty * filter_blacklist_property_
Definition: tf_display.h:124
FloatProperty * update_rate_property_
Definition: tf_display.h:118
Property specialized for string values.
MovableText * name_text_
Definition: tf_display.h:159
BoolProperty * show_axes_property_
Definition: tf_display.h:117
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:158
M_FrameInfo frames_
Definition: tf_display.h:108
Property * tree_property_
Definition: tf_display.h:175
ros::Time last_time_to_fixed_
Definition: tf_display.h:166
FloatProperty * frame_timeout_property_
Definition: tf_display.h:119
QuaternionProperty * orientation_property_
Definition: tf_display.h:171
uint32_t CollObjectHandle
Definition: forwards.h:45


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Sat May 27 2023 02:06:25