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>
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 
109 
110  typedef std::map<std::string, bool> M_EnabledState;
112 
114 
121 
124 
129 
131  friend class FrameInfo;
132 };
133 
135 class FrameInfo : public QObject
136 {
137  Q_OBJECT
138 public:
139  FrameInfo(TFDisplay* display);
140 
142  void setEnabled(bool enabled);
143 
144 public Q_SLOTS:
148 
152 
153 public:
155  std::string name_;
156  std::string parent_;
162  Ogre::SceneNode* name_node_;
163 
165  Ogre::Quaternion arrow_orientation_;
166 
169 
176 
178 };
179 
180 } // end namespace rviz
181 
182 #endif // RVIZ_TF_DISPLAY_H
rviz::FrameInfo::axes_
Axes * axes_
Definition: tf_display.h:157
rviz::FrameInfo::parent_arrow_
Arrow * parent_arrow_
Definition: tf_display.h:160
rviz::TFDisplay::reset
void reset() override
Called to tell the display to clear its state.
Definition: tf_display.cpp:804
rviz::TFDisplay::frames_
M_FrameInfo frames_
Definition: tf_display.h:108
rviz::TFDisplay::show_arrows_property_
BoolProperty * show_arrows_property_
Definition: tf_display.h:116
rviz::FrameInfo::tree_property_
Property * tree_property_
Definition: tf_display.h:177
rviz::TFDisplay::arrows_node_
Ogre::SceneNode * arrows_node_
Definition: tf_display.h:105
Ogre
Definition: axes_display.h:35
boost::shared_ptr< FrameSelectionHandler >
rviz::FrameInfo::last_update_
ros::Time last_update_
Definition: tf_display.h:167
rviz::Arrow
An arrow consisting of a cylinder and a cone.
Definition: arrow.h:57
rviz::FrameInfo::orientation_property_
QuaternionProperty * orientation_property_
Definition: tf_display.h:173
rviz::TFDisplay::allEnabledChanged
void allEnabledChanged()
Definition: tf_display.cpp:398
forwards.h
rviz::TFDisplay::deleteFrame
M_FrameInfo::iterator deleteFrame(M_FrameInfo::iterator it, bool delete_properties)
Definition: tf_display.cpp:774
rviz::TFDisplay::tree_category_
Property * tree_category_
Definition: tf_display.h:128
rviz::BoolProperty
Property specialized to provide getter for booleans.
Definition: bool_property.h:38
rviz::TFDisplay::changing_single_frame_enabled_state_
bool changing_single_frame_enabled_state_
Definition: tf_display.h:130
rviz::FrameInfo::name_
std::string name_
Definition: tf_display.h:155
rviz::TFDisplay::alpha_property_
FloatProperty * alpha_property_
Definition: tf_display.h:123
rviz::TFDisplay::getFrameInfo
FrameInfo * getFrameInfo(const std::string &frame)
Definition: tf_display.cpp:428
rviz::FrameSelectionHandlerPtr
boost::shared_ptr< FrameSelectionHandler > FrameSelectionHandlerPtr
Definition: tf_display.h:60
rviz::FrameInfo::rel_position_property_
VectorProperty * rel_position_property_
Definition: tf_display.h:170
rviz::TFDisplay::root_node_
Ogre::SceneNode * root_node_
Definition: tf_display.h:103
rviz::MovableText
Definition: movable_text.h:59
rviz::TFDisplay::M_EnabledState
std::map< std::string, bool > M_EnabledState
Definition: tf_display.h:110
rviz::TFDisplay::updateShowAxes
void updateShowAxes()
Definition: tf_display.cpp:370
rviz::CollObjectHandle
uint32_t CollObjectHandle
Definition: forwards.h:45
rviz::TFDisplay::updateShowNames
void updateShowNames()
Definition: tf_display.cpp:356
rviz::TFDisplay::names_node_
Ogre::SceneNode * names_node_
Definition: tf_display.h:104
rviz::FrameInfo::parent_property_
StringProperty * parent_property_
Definition: tf_display.h:174
rviz::TFDisplay::clear
void clear()
Definition: tf_display.cpp:324
rviz::Display
Definition: display.h:63
rviz::TFDisplay::updateFrame
void updateFrame(FrameInfo *frame)
Definition: tf_display.cpp:570
rviz::QuaternionProperty
Definition: quaternion_property.h:38
rviz::FloatProperty
Property specialized to enforce floating point max/min.
Definition: float_property.h:37
rviz::TFDisplay::show_names_property_
BoolProperty * show_names_property_
Definition: tf_display.h:115
rviz::Property
A single element of a property tree, with a name, value, description, and possibly children.
Definition: property.h:100
rviz::FrameInfo::distance_to_parent_
float distance_to_parent_
Definition: tf_display.h:164
rviz::TFDisplay::TFDisplay
TFDisplay()
Definition: tf_display.cpp:234
rviz::TFDisplay::frame_config_enabled_state_
M_EnabledState frame_config_enabled_state_
Definition: tf_display.h:111
rviz::TFDisplay::updateShowArrows
void updateShowArrows()
Definition: tf_display.cpp:384
rviz::TFDisplay::filter_whitelist_property_
RegexFilterProperty * filter_whitelist_property_
Definition: tf_display.h:125
rviz::FrameInfo::position_property_
VectorProperty * position_property_
Definition: tf_display.h:172
rviz::TFDisplay::~TFDisplay
~TFDisplay() override
Definition: tf_display.cpp:282
rviz
Definition: add_display_dialog.cpp:54
rviz::TFDisplay::axes_node_
Ogre::SceneNode * axes_node_
Definition: tf_display.h:106
rviz::StringProperty
Property specialized for string values.
Definition: string_property.h:39
rviz::TFDisplay::createFrame
FrameInfo * createFrame(const std::string &frame)
Definition: tf_display.cpp:486
rviz::FrameInfo::axes_coll_
CollObjectHandle axes_coll_
Definition: tf_display.h:158
ogre_vector.h
rviz::TFDisplay::updateFrames
void updateFrames()
Definition: tf_display.cpp:439
rviz::FrameInfo::name_text_
MovableText * name_text_
Definition: tf_display.h:161
rviz::FrameInfo::rel_orientation_property_
QuaternionProperty * rel_orientation_property_
Definition: tf_display.h:171
rviz::FrameInfo::updateVisibilityFromFrame
void updateVisibilityFromFrame()
Update whether the frame is visible or not, based on the enabled_property_ in this FrameInfo.
Definition: tf_display.cpp:825
rviz::FrameInfo::name_node_
Ogre::SceneNode * name_node_
Definition: tf_display.h:162
rviz::TFDisplay::all_enabled_property_
BoolProperty * all_enabled_property_
Definition: tf_display.h:120
rviz::RegexFilterProperty
Definition: tf_display.cpp:189
rviz::FrameInfo::selection_handler_
FrameSelectionHandlerPtr selection_handler_
Definition: tf_display.h:159
rviz::Axes
An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue.
Definition: axes.h:57
rviz::TFDisplay::M_FrameInfo
std::map< std::string, FrameInfo * > M_FrameInfo
Definition: tf_display.h:88
rviz::FrameInfo::enabled_property_
BoolProperty * enabled_property_
Definition: tf_display.h:175
rviz::FrameInfo::parent_
std::string parent_
Definition: tf_display.h:156
rviz::TFDisplay::fixedFrameChanged
void fixedFrameChanged() override
Called by setFixedFrame(). Override to respond to changes to fixed_frame_.
Definition: tf_display.cpp:799
rviz::TFDisplay::onDisable
void onDisable() override
Derived classes override this to do the actual work of disabling themselves.
Definition: tf_display.cpp:350
rviz::TFDisplay::show_axes_property_
BoolProperty * show_axes_property_
Definition: tf_display.h:117
display.h
rviz::TFDisplay::filter_blacklist_property_
RegexFilterProperty * filter_blacklist_property_
Definition: tf_display.h:126
ros::Time
rviz::FrameInfo::setEnabled
void setEnabled(bool enabled)
Set this frame to be visible or invisible.
Definition: tf_display.cpp:839
rviz::FrameInfo::last_time_to_fixed_
ros::Time last_time_to_fixed_
Definition: tf_display.h:168
rviz::TFDisplay::update_rate_property_
FloatProperty * update_rate_property_
Definition: tf_display.h:118
rviz::FrameInfo::display_
TFDisplay * display_
Definition: tf_display.h:154
rviz::TFDisplay::update_timer_
float update_timer_
Definition: tf_display.h:113
rviz::TFDisplay::update
void update(float wall_dt, float ros_dt) override
Called periodically by the visualization manager.
Definition: tf_display.cpp:416
rviz::VectorProperty
Definition: vector_property.h:39
rviz::FrameSelectionHandler
Definition: tf_display.cpp:56
rviz::TFDisplay::frames_category_
Property * frames_category_
Definition: tf_display.h:127
rviz::TFDisplay::onEnable
void onEnable() override
Derived classes override this to do the actual work of enabling themselves.
Definition: tf_display.cpp:341
rviz::TFDisplay::scale_property_
FloatProperty * scale_property_
Definition: tf_display.h:122
rviz::TFDisplay::load
void load(const Config &config) override
Load the value of this property and/or its children from the given Config reference.
Definition: tf_display.cpp:303
rviz::FrameInfo::updateVisibilityFromSelection
void updateVisibilityFromSelection()
Update whether the frame is visible or not, based on the enabled_property_ in the selection handler.
Definition: tf_display.cpp:832
rviz::TFDisplay::onInitialize
void onInitialize() override
Override this function to do subclass-specific initialization.
Definition: tf_display.cpp:292
config
config
rviz::TFDisplay
Displays a visual representation of the TF hierarchy.
Definition: tf_display.h:65
rviz::Config
Configuration data storage class.
Definition: config.h:124
rviz::TFDisplay::frame_timeout_property_
FloatProperty * frame_timeout_property_
Definition: tf_display.h:119
rviz::FrameInfo
Internal class needed only by TFDisplay.
Definition: tf_display.h:135
rviz::FrameInfo::FrameInfo
FrameInfo(TFDisplay *display)
Definition: tf_display.cpp:813
rviz::FrameInfo::arrow_orientation_
Ogre::Quaternion arrow_orientation_
Definition: tf_display.h:165


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Fri Dec 13 2024 03:31:03