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_ */
FloatProperty * arrow3d_head_length_property_
ColorProperty * arrow_color_property_
FloatProperty * arrow2d_length_property_
Displays a geometry_msgs/PoseArray message as a bunch of line-drawn arrows.
FloatProperty * axes_radius_property_
Property specialized to enforce floating point max/min.
FloatProperty * arrow3d_shaft_radius_property_
std::vector< OgrePose > poses_
FloatProperty * arrow_alpha_property_
Display subclass using a tf2_ros::MessageFilter, templated on the ROS message type.
FloatProperty * axes_length_property_
FloatProperty * arrow3d_shaft_length_property_
An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue.
Definition: axes.h:59
EnumProperty * shape_property_
An arrow consisting of a cylinder and a cone.
Definition: arrow.h:59
boost::ptr_vector< Arrow > arrows3d_
const std::string header
Ogre::SceneNode * arrow_node_
FloatProperty * arrow3d_head_radius_property_
boost::ptr_vector< Axes > axes_
Enum property.
Definition: enum_property.h:46
Ogre::ManualObject * manual_object_
Ogre::SceneNode * axes_node_


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