hri_tf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022, PAL Robotics S.L.
3  * Copyright (c) 2012, Willow Garage, Inc.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * Neither the name of the Willow Garage, Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef RVIZ_TF_DISPLAY_H
32 #define RVIZ_TF_DISPLAY_H
33 
34 #include <map>
35 #include <set>
36 
37 #include <OGRE/OgreQuaternion.h>
38 #include <OGRE/OgreVector3.h>
39 
41 
42 #include <rviz/display.h>
43 
44 #include "hri/hri.h"
45 #include "ros/ros.h"
46 
47 namespace Ogre
48 {
49 class SceneNode;
50 }
51 
52 namespace rviz
53 {
54 class Arrow;
55 class Axes;
56 class BoolProperty;
57 class FloatProperty;
58 class MovableText;
59 class QuaternionProperty;
60 class StringProperty;
61 class VectorProperty;
62 
63 class FrameInfo;
66 
68 class HRITFDisplay : public Display
69 {
70  Q_OBJECT
71 public:
72  HRITFDisplay();
73  ~HRITFDisplay() override;
74 
75  void update(float wall_dt, float ros_dt) override;
76 
77 protected:
78  // Overrides from Display
79  void onInitialize() override;
80  void load(const Config& config) override;
81  void fixedFrameChanged() override;
82  void reset() override;
83 
84 private Q_SLOTS:
85  void updateShowAxes();
86  void updateShowArrows();
87  void updateShowNames();
88  void updateShowFaces();
89  void updateShowGazes();
90  void updateshowSkeletons();
91  void allEnabledChanged();
92 
93 private:
94  typedef std::map<std::string, FrameInfo*> M_FrameInfo;
95 
96  void updateFrames();
97  FrameInfo* createFrame(const std::string& frame);
98  void updateFrame(FrameInfo* frame);
99  M_FrameInfo::iterator deleteFrame(M_FrameInfo::iterator it, bool delete_properties);
100 
101  FrameInfo* getFrameInfo(const std::string& frame);
102 
103  void clear();
104 
105  // overrides from Display
106  void onEnable() override;
107  void onDisable() override;
108 
109  Ogre::SceneNode* root_node_;
110  Ogre::SceneNode* names_node_;
111  Ogre::SceneNode* arrows_node_;
112  Ogre::SceneNode* axes_node_;
113 
115 
116  typedef std::map<std::string, bool> M_EnabledState;
118 
120 
127 
130 
134 
137 
142 
144 
145  std::vector<std::string> skeleton_components_;
146 
147  friend class FrameInfo;
148 };
149 
151 class FrameInfo : public QObject
152 {
153  Q_OBJECT
154 public:
155  FrameInfo(HRITFDisplay* display);
156 
158  void setEnabled(bool enabled);
159 
160 public Q_SLOTS:
164 
168 
169 public:
171  std::string name_;
172  std::string parent_;
173  Axes* axes_;
178  Ogre::SceneNode* name_node_;
179 
180  float distance_to_parent_;
181  Ogre::Quaternion arrow_orientation_;
182 
185 
192 
194 
195 };
196 
197 } // end namespace rviz
198 
199 #endif // RVIZ_TF_DISPLAY_H
rviz::HRITFDisplay::frames_
M_FrameInfo frames_
Definition: hri_tf.h:114
rviz::FrameInfo::axes_
Axes * axes_
Definition: hri_tf.h:173
rviz::HRITFDisplay::names_node_
Ogre::SceneNode * names_node_
Definition: hri_tf.h:110
rviz::FrameInfo::parent_arrow_
Arrow * parent_arrow_
Definition: hri_tf.h:176
forwards.h
rviz::FrameInfo::tree_property_
Property * tree_property_
Definition: hri_tf.h:193
rviz::HRITFDisplay::M_EnabledState
std::map< std::string, bool > M_EnabledState
Definition: hri_tf.h:116
rviz::HRITFDisplay::showSkeletons_
bool showSkeletons_
Definition: hri_tf.h:141
rviz::HRITFDisplay::showGazes_
bool showGazes_
Definition: hri_tf.h:140
Ogre
rviz::HRITFDisplay::updateShowFaces
void updateShowFaces()
Definition: hri_tf.cpp:348
rviz::HRITFDisplay::load
void load(const Config &config) override
Definition: hri_tf.cpp:267
rviz::HRITFDisplay::fixedFrameChanged
void fixedFrameChanged() override
Definition: hri_tf.cpp:827
rviz::HRITFDisplay::frame_timeout_property_
FloatProperty * frame_timeout_property_
Definition: hri_tf.h:125
boost::shared_ptr< FrameSelectionHandler >
rviz::FrameInfo::last_update_
ros::Time last_update_
Definition: hri_tf.h:183
rviz::Arrow
rviz::FrameInfo::orientation_property_
QuaternionProperty * orientation_property_
Definition: hri_tf.h:189
rviz::HRITFDisplay::onDisable
void onDisable() override
Definition: hri_tf.cpp:314
rviz::HRITFDisplay::root_node_
Ogre::SceneNode * root_node_
Definition: hri_tf.h:109
ros.h
rviz::HRITFDisplay::updateShowAxes
void updateShowAxes()
Definition: hri_tf.cpp:334
rviz::BoolProperty
rviz::HRITFDisplay::M_FrameInfo
std::map< std::string, FrameInfo * > M_FrameInfo
Definition: hri_tf.h:94
rviz::FrameInfo::name_
std::string name_
Definition: hri_tf.h:171
rviz::HRITFDisplay::clear
void clear()
Definition: hri_tf.cpp:288
rviz::HRITFDisplay
Displays a visual representation of the TF hierarchy.
Definition: hri_tf.h:68
rviz::HRITFDisplay::onEnable
void onEnable() override
Definition: hri_tf.cpp:305
rviz::HRITFDisplay::~HRITFDisplay
~HRITFDisplay() override
Definition: hri_tf.cpp:246
rviz::FrameSelectionHandlerPtr
boost::shared_ptr< FrameSelectionHandler > FrameSelectionHandlerPtr
rviz::HRITFDisplay::tree_category_
Property * tree_category_
Definition: hri_tf.h:136
rviz::FrameInfo::rel_position_property_
VectorProperty * rel_position_property_
Definition: hri_tf.h:186
rviz::HRITFDisplay::hri_listener_
hri::HRIListener hri_listener_
Definition: hri_tf.h:143
display.h
rviz::HRITFDisplay::deleteFrame
M_FrameInfo::iterator deleteFrame(M_FrameInfo::iterator it, bool delete_properties)
Definition: hri_tf.cpp:808
rviz::MovableText
rviz::HRITFDisplay::scale_property_
FloatProperty * scale_property_
Definition: hri_tf.h:128
rviz::CollObjectHandle
uint32_t CollObjectHandle
rviz::FrameInfo::parent_property_
StringProperty * parent_property_
Definition: hri_tf.h:190
rviz::Display
rviz::HRITFDisplay::axes_node_
Ogre::SceneNode * axes_node_
Definition: hri_tf.h:112
rviz::HRITFDisplay::show_skeletons_property_
BoolProperty * show_skeletons_property_
Definition: hri_tf.h:133
rviz::QuaternionProperty
rviz::FloatProperty
rviz::Property
rviz::FrameInfo::distance_to_parent_
float distance_to_parent_
Definition: hri_tf.h:180
rviz::HRITFDisplay::all_enabled_property_
BoolProperty * all_enabled_property_
Definition: hri_tf.h:126
rviz::HRITFDisplay::frame_config_enabled_state_
M_EnabledState frame_config_enabled_state_
Definition: hri_tf.h:117
rviz::HRITFDisplay::updateShowArrows
void updateShowArrows()
Definition: hri_tf.cpp:360
rviz::HRITFDisplay::updateShowNames
void updateShowNames()
Definition: hri_tf.cpp:320
rviz::HRITFDisplay::show_axes_property_
BoolProperty * show_axes_property_
Definition: hri_tf.h:123
rviz::HRITFDisplay::updateFrames
void updateFrames()
Definition: hri_tf.cpp:415
rviz::FrameInfo::position_property_
VectorProperty * position_property_
Definition: hri_tf.h:188
rviz
rviz::HRITFDisplay::showFaces_
bool showFaces_
Definition: hri_tf.h:139
rviz::HRITFDisplay::changing_single_frame_enabled_state_
bool changing_single_frame_enabled_state_
Definition: hri_tf.h:138
rviz::StringProperty
rviz::HRITFDisplay::alpha_property_
FloatProperty * alpha_property_
Definition: hri_tf.h:129
rviz::HRITFDisplay::reset
void reset() override
Definition: hri_tf.cpp:832
rviz::FrameInfo::axes_coll_
CollObjectHandle axes_coll_
Definition: hri_tf.h:174
rviz::FrameInfo::name_text_
MovableText * name_text_
Definition: hri_tf.h:177
rviz::HRITFDisplay::createFrame
FrameInfo * createFrame(const std::string &frame)
Definition: hri_tf.cpp:534
rviz::FrameInfo::rel_orientation_property_
QuaternionProperty * rel_orientation_property_
Definition: hri_tf.h:187
rviz::FrameInfo::updateVisibilityFromFrame
void updateVisibilityFromFrame()
Definition: hri_tf.cpp:853
rviz::FrameInfo::name_node_
Ogre::SceneNode * name_node_
Definition: hri_tf.h:178
rviz::HRITFDisplay::arrows_node_
Ogre::SceneNode * arrows_node_
Definition: hri_tf.h:111
rviz::HRITFDisplay::updateshowSkeletons
void updateshowSkeletons()
Definition: hri_tf.cpp:356
rviz::FrameInfo::selection_handler_
FrameSelectionHandlerPtr selection_handler_
Definition: hri_tf.h:175
rviz::Axes
rviz::FrameInfo::enabled_property_
BoolProperty * enabled_property_
Definition: hri_tf.h:191
rviz::HRITFDisplay::show_names_property_
BoolProperty * show_names_property_
Definition: hri_tf.h:121
rviz::FrameInfo::parent_
std::string parent_
Definition: hri_tf.h:172
rviz::HRITFDisplay::show_gazes_property_
BoolProperty * show_gazes_property_
Definition: hri_tf.h:132
rviz::HRITFDisplay::update
void update(float wall_dt, float ros_dt) override
Definition: hri_tf.cpp:392
rviz::HRITFDisplay::show_faces_property_
BoolProperty * show_faces_property_
Definition: hri_tf.h:131
rviz::HRITFDisplay::update_timer_
float update_timer_
Definition: hri_tf.h:119
ros::Time
hri::HRIListener
rviz::FrameInfo::setEnabled
void setEnabled(bool enabled)
Definition: hri_tf.cpp:867
rviz::FrameInfo::last_time_to_fixed_
ros::Time last_time_to_fixed_
Definition: hri_tf.h:184
rviz::FrameInfo::display_
TFDisplay * display_
rviz::HRITFDisplay::updateFrame
void updateFrame(FrameInfo *frame)
Definition: hri_tf.cpp:606
rviz::HRITFDisplay::onInitialize
void onInitialize() override
Definition: hri_tf.cpp:256
rviz::HRITFDisplay::show_arrows_property_
BoolProperty * show_arrows_property_
Definition: hri_tf.h:122
rviz::HRITFDisplay::HRITFDisplay
HRITFDisplay()
Definition: hri_tf.cpp:162
rviz::VectorProperty
rviz::FrameSelectionHandler
Definition: hri_tf.cpp:53
rviz::HRITFDisplay::updateShowGazes
void updateShowGazes()
Definition: hri_tf.cpp:352
rviz::FrameInfo::updateVisibilityFromSelection
void updateVisibilityFromSelection()
Definition: hri_tf.cpp:860
config
config
rviz::HRITFDisplay::frames_category_
Property * frames_category_
Definition: hri_tf.h:135
rviz::HRITFDisplay::allEnabledChanged
void allEnabledChanged()
Definition: hri_tf.cpp:374
rviz::Config
rviz::HRITFDisplay::update_rate_property_
FloatProperty * update_rate_property_
Definition: hri_tf.h:124
rviz::FrameInfo
Internal class needed only by HRITFDisplay.
Definition: hri_tf.h:151
rviz::HRITFDisplay::skeleton_components_
std::vector< std::string > skeleton_components_
Definition: hri_tf.h:145
rviz::FrameInfo::FrameInfo
FrameInfo(TFDisplay *display)
rviz::FrameInfo::arrow_orientation_
Ogre::Quaternion arrow_orientation_
Definition: hri_tf.h:181
rviz::HRITFDisplay::getFrameInfo
FrameInfo * getFrameInfo(const std::string &frame)
Definition: hri_tf.cpp:404
hri.h


hri_rviz
Author(s): Lorenzo Ferrini, Séverin Lemaignan
autogenerated on Fri Oct 20 2023 02:53:21