odometry_display.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 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 
31 #ifndef RVIZ_ODOMETRY_DISPLAY_H_
32 #define RVIZ_ODOMETRY_DISPLAY_H_
33 
34 #include <deque>
35 
36 #include <boost/shared_ptr.hpp>
37 #include <boost/thread/mutex.hpp>
38 
39 #ifndef Q_MOC_RUN
41 #endif
42 
44 #include <nav_msgs/Odometry.h>
45 
46 namespace rviz
47 {
48 class Arrow;
49 class Axes;
50 class ColorProperty;
51 class FloatProperty;
52 class IntProperty;
53 class EnumProperty;
54 
55 class CovarianceProperty;
56 
61 class OdometryDisplay : public rviz::MessageFilterDisplay<nav_msgs::Odometry>
62 {
63  Q_OBJECT
64 public:
65  enum Shape
66  {
69  };
70 
72  ~OdometryDisplay() override;
73 
74  // Overides of MessageFilterDisplay
75  void onInitialize() override;
76  void reset() override;
77  // Overides of Display
78  void update(float wall_dt, float ros_dt) override;
79 
80 protected:
82  void onEnable() override;
83 
84 private Q_SLOTS:
85  void updateShapeChoice();
86  void updateShapeVisibility();
87  void updateColorAndAlpha();
88  void updateArrowsGeometry();
89  void updateAxisGeometry();
90 
91 private:
92  void updateGeometry(rviz::Arrow* arrow);
93  void updateGeometry(rviz::Axes* axes);
94  void clear();
95 
96  void processMessage(const nav_msgs::Odometry::ConstPtr& message) override;
97 
98  typedef std::deque<rviz::Arrow*> D_Arrow;
99  typedef std::deque<rviz::Axes*> D_Axes;
100 
101  D_Arrow arrows_;
102  D_Axes axes_;
103 
104  nav_msgs::Odometry::ConstPtr last_used_message_;
105 
107 
113 
118 
121 
123 };
124 
125 } // namespace rviz
126 
127 #endif /* RVIZ_ODOMETRY_DISPLAY_H_ */
std::deque< rviz::Axes * > D_Axes
nav_msgs::Odometry::ConstPtr last_used_message_
void onInitialize() override
Override this function to do subclass-specific initialization.
void update(float wall_dt, float ros_dt) override
Called periodically by the visualization manager.
void onEnable() override
Overridden from MessageFilterDisplay to get Arrow/Axes visibility correct.
rviz::FloatProperty * head_length_property_
rviz::FloatProperty * axes_radius_property_
Property specialized to enforce floating point max/min.
Property specialized to provide max/min enforcement for integers.
Definition: int_property.h:37
rviz::FloatProperty * position_tolerance_property_
rviz::FloatProperty * shaft_length_property_
rviz::EnumProperty * shape_property_
Display subclass using a tf2_ros::MessageFilter, templated on the ROS message type.
void reset() override
Called to tell the display to clear its state.
Accumulates and displays the pose from a nav_msgs::Odometry message.
rviz::FloatProperty * angle_tolerance_property_
void updateGeometry(rviz::Arrow *arrow)
CovarianceProperty * covariance_property_
An object that displays a set of X/Y/Z axes, with X=Red, Y=Green, Z=Blue.
Definition: axes.h:59
void processMessage(const nav_msgs::Odometry::ConstPtr &message) override
std::deque< rviz::Arrow * > D_Arrow
rviz::IntProperty * keep_property_
Property specialized to provide getter for booleans.
rviz::FloatProperty * alpha_property_
An arrow consisting of a cylinder and a cone.
Definition: arrow.h:59
rviz::FloatProperty * axes_length_property_
rviz::ColorProperty * color_property_
Enum property.
Definition: enum_property.h:46
rviz::FloatProperty * head_radius_property_
rviz::FloatProperty * shaft_radius_property_


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