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 
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_ */
rviz::OdometryDisplay::shaft_radius_property_
rviz::FloatProperty * shaft_radius_property_
Definition: odometry_display.h:116
rviz::MessageFilterDisplay
Display subclass using a tf2_ros::MessageFilter, templated on the ROS message type.
Definition: message_filter_display.h:90
rviz::OdometryDisplay::last_used_message_
nav_msgs::Odometry::ConstPtr last_used_message_
Definition: odometry_display.h:104
rviz::OdometryDisplay::D_Axes
std::deque< rviz::Axes * > D_Axes
Definition: odometry_display.h:99
rviz::OdometryDisplay::AxesShape
@ AxesShape
Definition: odometry_display.h:68
rviz::OdometryDisplay
Accumulates and displays the pose from a nav_msgs::Odometry message.
Definition: odometry_display.h:61
rviz::OdometryDisplay::~OdometryDisplay
~OdometryDisplay() override
Definition: odometry_display.cpp:111
message_filter_display.h
rviz::Arrow
An arrow consisting of a cylinder and a cone.
Definition: arrow.h:57
rviz::OdometryDisplay::onInitialize
void onInitialize() override
Override this function to do subclass-specific initialization.
Definition: odometry_display.cpp:119
rviz::OdometryDisplay::update
void update(float wall_dt, float ros_dt) override
Called periodically by the visualization manager.
Definition: odometry_display.cpp:355
rviz::CovarianceProperty
Property specialized to provide getter for booleans.
Definition: covariance_property.h:56
rviz::OdometryDisplay::updateColorAndAlpha
void updateColorAndAlpha()
Definition: odometry_display.cpp:158
rviz::OdometryDisplay::updateShapeVisibility
void updateShapeVisibility()
Definition: odometry_display.cpp:228
rviz::OdometryDisplay::head_length_property_
rviz::FloatProperty * head_length_property_
Definition: odometry_display.h:115
rviz::OdometryDisplay::axes_
D_Axes axes_
Definition: odometry_display.h:102
rviz::ColorProperty
Definition: color_property.h:40
rviz::OdometryDisplay::onEnable
void onEnable() override
Overridden from MessageFilterDisplay to get Arrow/Axes visibility correct.
Definition: odometry_display.cpp:125
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::OdometryDisplay::shape_property_
rviz::EnumProperty * shape_property_
Definition: odometry_display.h:106
rviz::OdometryDisplay::axes_radius_property_
rviz::FloatProperty * axes_radius_property_
Definition: odometry_display.h:120
rviz::OdometryDisplay::shaft_length_property_
rviz::FloatProperty * shaft_length_property_
Definition: odometry_display.h:117
rviz
Definition: add_display_dialog.cpp:54
subscriber.h
rviz::OdometryDisplay::processMessage
void processMessage(const nav_msgs::Odometry::ConstPtr &message) override
Definition: odometry_display.cpp:257
rviz::OdometryDisplay::angle_tolerance_property_
rviz::FloatProperty * angle_tolerance_property_
Definition: odometry_display.h:111
rviz::OdometryDisplay::position_tolerance_property_
rviz::FloatProperty * position_tolerance_property_
Definition: odometry_display.h:110
rviz::OdometryDisplay::updateGeometry
void updateGeometry(rviz::Arrow *arrow)
Definition: odometry_display.cpp:203
rviz::OdometryDisplay::reset
void reset() override
Called to tell the display to clear its state.
Definition: odometry_display.cpp:377
rviz::OdometryDisplay::Shape
Shape
Definition: odometry_display.h:65
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::OdometryDisplay::updateShapeChoice
void updateShapeChoice()
Definition: odometry_display.cpp:209
rviz::OdometryDisplay::covariance_property_
CovarianceProperty * covariance_property_
Definition: odometry_display.h:122
rviz::OdometryDisplay::head_radius_property_
rviz::FloatProperty * head_radius_property_
Definition: odometry_display.h:114
rviz::OdometryDisplay::updateArrowsGeometry
void updateArrowsGeometry()
Definition: odometry_display.cpp:176
rviz::OdometryDisplay::axes_length_property_
rviz::FloatProperty * axes_length_property_
Definition: odometry_display.h:119
rviz::OdometryDisplay::D_Arrow
std::deque< rviz::Arrow * > D_Arrow
Definition: odometry_display.h:98
rviz::OdometryDisplay::ArrowShape
@ ArrowShape
Definition: odometry_display.h:67
rviz::OdometryDisplay::arrows_
D_Arrow arrows_
Definition: odometry_display.h:101
rviz::OdometryDisplay::updateAxisGeometry
void updateAxisGeometry()
Definition: odometry_display.cpp:187
rviz::OdometryDisplay::keep_property_
rviz::IntProperty * keep_property_
Definition: odometry_display.h:112
rviz::OdometryDisplay::OdometryDisplay
OdometryDisplay()
Definition: odometry_display.cpp:48
rviz::OdometryDisplay::color_property_
rviz::ColorProperty * color_property_
Definition: odometry_display.h:108
rviz::OdometryDisplay::alpha_property_
rviz::FloatProperty * alpha_property_
Definition: odometry_display.h:109
rviz::OdometryDisplay::clear
void clear()
Definition: odometry_display.cpp:131
rviz::IntProperty
Property specialized to provide max/min enforcement for integers.
Definition: int_property.h:37


rviz
Author(s): Dave Hershberger, David Gossow, Josh Faust, William Woodall
autogenerated on Sat Jun 1 2024 02:31:53