vector3_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 HECTOR_RVIZ_PLUGINS_VECTOR3_DISPLAY_H
31 #define HECTOR_RVIZ_PLUGINS_VECTOR3_DISPLAY_H
32 
33 #include <boost/shared_ptr.hpp>
34 #include <boost/thread/mutex.hpp>
35 
36 #ifndef Q_MOC_RUN
38 #include <tf/message_filter.h>
39 #endif
40 
41 #include <geometry_msgs/Vector3Stamped.h>
42 
43 #include <rviz/display.h>
44 
45 namespace rviz
46 {
47 class Arrow;
48 class ColorProperty;
49 class FloatProperty;
50 class StringProperty;
51 class IntProperty;
52 class RosTopicProperty;
53 class TfFrameProperty;
54 }
55 
56 namespace Ogre
57 {
58 class Vector3;
59 class Quaternion;
60 }
61 
62 namespace hector_rviz_plugins
63 {
64 
65 using namespace rviz;
66 
68 {
69 Q_OBJECT
70 public:
72  virtual ~Vector3Display();
73 
74  // Overrides from Display
75  virtual void onInitialize();
76  virtual void fixedFrameChanged();
77  virtual void update( float wall_dt, float ros_dt );
78  virtual void reset();
79 
80 protected:
81  // overrides from Display
82  virtual void onEnable();
83  virtual void onDisable();
84 
85 private Q_SLOTS:
86  void updateColor();
87  void updateTopic();
88  void updateOriginFrame();
89  void updateScale();
90  void updateLength();
91 
92 private:
93  void subscribe();
94  void unsubscribe();
95  void clear();
96 
97  void incomingMessage( const geometry_msgs::Vector3Stamped::ConstPtr& message );
98  void transformArrow( const geometry_msgs::Vector3Stamped::ConstPtr& message, Arrow* arrow );
99 
100  typedef std::deque<Arrow*> D_Arrow;
101  D_Arrow arrows_;
102 
104 
107 
110 
118 };
119 
120 } // end namespace hector_rviz_plugins
121 
122 #endif // HECTOR_RVIZ_PLUGINS_VECTOR3_DISPLAY_H
message_filters::Subscriber< geometry_msgs::Vector3Stamped > sub_
boost::shared_ptr< Ogre::Quaternion > last_orientation_
boost::shared_ptr< Ogre::Vector3 > last_position_
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
void subscribe()
TFSIMD_FORCE_INLINE Vector3()
tf::MessageFilter< geometry_msgs::Vector3Stamped > * tf_filter_


hector_rviz_plugins
Author(s): Johannes Meyer
autogenerated on Mon Jun 10 2019 13:36:38