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 
47 class EnumProperty;
48 class ColorProperty;
49 class FloatProperty;
50 class Arrow;
51 class Axes;
52 
54 class PoseArrayDisplay: public MessageFilterDisplay<geometry_msgs::PoseArray>
55 {
56 Q_OBJECT
57 public:
59  virtual ~PoseArrayDisplay();
60 
61 protected:
62  virtual void onInitialize();
63  virtual void reset();
64  virtual void processMessage( const geometry_msgs::PoseArray::ConstPtr& msg );
65 
66 private:
67  bool setTransform(std_msgs::Header const & header);
68  void updateArrows2d();
69  void updateArrows3d();
70  void updateAxes();
71  void updateDisplay();
72  Axes * makeAxes();
73  Arrow * makeArrow3d();
74 
75  struct OgrePose {
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 tf::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:58
EnumProperty * shape_property_
An arrow consisting of a cylinder and a cone.
Definition: arrow.h:59
boost::ptr_vector< Arrow > arrows3d_
Ogre::SceneNode * arrow_node_
FloatProperty * arrow3d_head_radius_property_
boost::ptr_vector< Axes > axes_
Enum property.
Definition: enum_property.h:47
Ogre::ManualObject * manual_object_
Ogre::SceneNode * axes_node_


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust
autogenerated on Wed Aug 28 2019 04:01:51