pose_array_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_POSE_ARRAY_DISPLAY_H_
31 #define RVIZ_POSE_ARRAY_DISPLAY_H_
32 
33 #include <geometry_msgs/PoseArray.h>
34 
36 
37 #include <boost/ptr_container/ptr_vector.hpp>
38 
39 namespace Ogre
40 {
41 class ManualObject;
42 }
43 
44 namespace rviz
45 {
46 class EnumProperty;
47 class ColorProperty;
48 class FloatProperty;
49 class Arrow;
50 class Axes;
51 
53 class PoseArrayDisplay : public MessageFilterDisplay<geometry_msgs::PoseArray>
54 {
55  Q_OBJECT
56 public:
58  ~PoseArrayDisplay() override;
59 
60 protected:
61  void onInitialize() override;
62  void reset() override;
63  void processMessage(const geometry_msgs::PoseArray::ConstPtr& msg) override;
64 
65 private:
66  bool setTransform(std_msgs::Header const& header);
67  void updateArrows2d();
68  void updateArrows3d();
69  void updateAxes();
70  void updateDisplay();
71  Axes* makeAxes();
72  Arrow* makeArrow3d();
73 
74  struct OgrePose
75  {
76  Ogre::Vector3 position;
77  Ogre::Quaternion orientation;
78  };
79 
80  std::vector<OgrePose> poses_;
81  boost::ptr_vector<Arrow> arrows3d_;
82  boost::ptr_vector<Axes> axes_;
83 
84  Ogre::SceneNode* arrow_node_;
85  Ogre::SceneNode* axes_node_;
86  Ogre::ManualObject* manual_object_;
87 
91 
93 
98 
101 
102 private Q_SLOTS:
104  void updateShapeChoice();
105 
107  void updateArrowColor();
108 
110  void updateArrow2dGeometry();
111 
113  void updateArrow3dGeometry();
114 
116  void updateAxesGeometry();
117 };
118 
119 } // namespace rviz
120 
121 #endif /* RVIZ_POSE_ARRAY_DISPLAY_H_ */
rviz::PoseArrayDisplay::OgrePose::orientation
Ogre::Quaternion orientation
Definition: pose_array_display.h:77
rviz::PoseArrayDisplay::arrow2d_length_property_
FloatProperty * arrow2d_length_property_
Definition: pose_array_display.h:92
rviz::PoseArrayDisplay::makeAxes
Axes * makeAxes()
Definition: pose_array_display.cpp:291
rviz::PoseArrayDisplay::updateAxesGeometry
void updateAxesGeometry()
Update the axes geometry.
Definition: pose_array_display.cpp:371
rviz::MessageFilterDisplay
Display subclass using a tf2_ros::MessageFilter, templated on the ROS message type.
Definition: message_filter_display.h:90
rviz::PoseArrayDisplay::updateArrowColor
void updateArrowColor()
Update the arrow color.
Definition: pose_array_display.cpp:333
rviz::PoseArrayDisplay::arrow_color_property_
ColorProperty * arrow_color_property_
Definition: pose_array_display.h:89
rviz::PoseArrayDisplay::processMessage
void processMessage(const geometry_msgs::PoseArray::ConstPtr &msg) override
Definition: pose_array_display.cpp:141
Ogre
Definition: axes_display.h:35
rviz::PoseArrayDisplay::arrow3d_shaft_length_property_
FloatProperty * arrow3d_shaft_length_property_
Definition: pose_array_display.h:97
message_filter_display.h
rviz::Arrow
An arrow consisting of a cylinder and a cone.
Definition: arrow.h:57
rviz::PoseArrayDisplay::updateArrow3dGeometry
void updateArrow3dGeometry()
Update the 3D arrow geometry.
Definition: pose_array_display.cpp:359
rviz::PoseArrayDisplay::shape_property_
EnumProperty * shape_property_
Definition: pose_array_display.h:88
rviz::PoseArrayDisplay::updateDisplay
void updateDisplay()
Definition: pose_array_display.cpp:226
rviz::PoseArrayDisplay::setTransform
bool setTransform(std_msgs::Header const &header)
Definition: pose_array_display.cpp:179
rviz::PoseArrayDisplay::arrow_alpha_property_
FloatProperty * arrow_alpha_property_
Definition: pose_array_display.h:90
rviz::PoseArrayDisplay::arrows3d_
boost::ptr_vector< Arrow > arrows3d_
Definition: pose_array_display.h:81
rviz::ColorProperty
Definition: color_property.h:40
rviz::EnumProperty
Enum property.
Definition: enum_property.h:46
rviz::FloatProperty
Property specialized to enforce floating point max/min.
Definition: float_property.h:37
rviz::PoseArrayDisplay::updateArrow2dGeometry
void updateArrow2dGeometry()
Update the flat arrow geometry.
Definition: pose_array_display.cpp:353
rviz::PoseArrayDisplay::arrow_node_
Ogre::SceneNode * arrow_node_
Definition: pose_array_display.h:84
rviz
Definition: add_display_dialog.cpp:54
rviz::PoseArrayDisplay::arrow3d_head_length_property_
FloatProperty * arrow3d_head_length_property_
Definition: pose_array_display.h:95
rviz::PoseArrayDisplay
Displays a geometry_msgs/PoseArray message as a bunch of line-drawn arrows.
Definition: pose_array_display.h:53
rviz::PoseArrayDisplay::updateArrows2d
void updateArrows2d()
Definition: pose_array_display.cpp:194
rviz::PoseArrayDisplay::makeArrow3d
Arrow * makeArrow3d()
Definition: pose_array_display.cpp:277
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::PoseArrayDisplay::updateShapeChoice
void updateShapeChoice()
Update the interface and visible shapes based on the selected shape type.
Definition: pose_array_display.cpp:308
rviz::PoseArrayDisplay::axes_length_property_
FloatProperty * axes_length_property_
Definition: pose_array_display.h:99
rviz::PoseArrayDisplay::arrow3d_head_radius_property_
FloatProperty * arrow3d_head_radius_property_
Definition: pose_array_display.h:94
rviz::PoseArrayDisplay::axes_
boost::ptr_vector< Axes > axes_
Definition: pose_array_display.h:82
rviz::PoseArrayDisplay::axes_node_
Ogre::SceneNode * axes_node_
Definition: pose_array_display.h:85
rviz::PoseArrayDisplay::updateAxes
void updateAxes()
Definition: pose_array_display.cpp:264
rviz::PoseArrayDisplay::updateArrows3d
void updateArrows3d()
Definition: pose_array_display.cpp:249
rviz::PoseArrayDisplay::manual_object_
Ogre::ManualObject * manual_object_
Definition: pose_array_display.h:86
rviz::PoseArrayDisplay::OgrePose
Definition: pose_array_display.h:74
rviz::PoseArrayDisplay::axes_radius_property_
FloatProperty * axes_radius_property_
Definition: pose_array_display.h:100
header
const std::string header
rviz::PoseArrayDisplay::PoseArrayDisplay
PoseArrayDisplay()
Definition: pose_array_display.cpp:73
rviz::PoseArrayDisplay::onInitialize
void onInitialize() override
Override this function to do subclass-specific initialization.
Definition: pose_array_display.cpp:125
rviz::PoseArrayDisplay::arrow3d_shaft_radius_property_
FloatProperty * arrow3d_shaft_radius_property_
Definition: pose_array_display.h:96
rviz::PoseArrayDisplay::reset
void reset() override
Called to tell the display to clear its state.
Definition: pose_array_display.cpp:297
rviz::PoseArrayDisplay::OgrePose::position
Ogre::Vector3 position
Definition: pose_array_display.h:76
rviz::PoseArrayDisplay::~PoseArrayDisplay
~PoseArrayDisplay() override
Definition: pose_array_display.cpp:117
rviz::PoseArrayDisplay::poses_
std::vector< OgrePose > poses_
Definition: pose_array_display.h:80


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