path_display.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * 2020, Locus Robotics
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  * * Neither the name of the Willow Garage, Inc. or Locus Robotics nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef ROBOT_NAV_RVIZ_PLUGINS_PATH_DISPLAY_H
32 #define ROBOT_NAV_RVIZ_PLUGINS_PATH_DISPLAY_H
33 
34 #include <nav_2d_msgs/Path2D.h>
37 #include <rviz/ogre_helpers/axes.h>
44 #include <OgreManualObject.h>
45 #include <vector>
46 
47 namespace robot_nav_rviz_plugins
48 {
54 class PathDisplay: public rviz::MessageFilterDisplay<nav_2d_msgs::Path2D>
55 {
56 Q_OBJECT
57 public:
58  PathDisplay();
59  virtual ~PathDisplay();
60  void reset() override;
61 
62 protected:
63  void onInitialize() override;
64  void processMessage(const nav_2d_msgs::Path2D::ConstPtr& msg) override;
65 
66 private Q_SLOTS:
67  void updateBufferLength();
68  void updateStyle();
69  void updateLineWidth();
70  void updateOffset();
71  void updatePoseStyle();
73  void updatePoseArrowColor();
75 
76 private:
77  // Display Option Enums
78  enum struct LineStyle {LINES, BILLBOARDS};
79  enum struct PoseStyle {NONE, AXES, ARROWS};
80  LineStyle getLineStyle() const { return static_cast<LineStyle>(style_property_->getOptionInt()); }
81  PoseStyle getPoseStyle() const { return static_cast<PoseStyle>(pose_style_property_->getOptionInt()); }
82 
83  void destroyObjects();
84  void allocateArrowVector(std::vector<rviz::Arrow*>& arrow_vect, int num);
85  void allocateAxesVector(std::vector<rviz::Axes*>& axes_vect, int num);
86 
87  std::vector<Ogre::ManualObject*> manual_objects_;
88  std::vector<rviz::BillboardLine*> billboard_lines_;
89  std::vector<std::vector<rviz::Axes*>> axes_chain_;
90  std::vector<std::vector<rviz::Arrow*>> arrow_chain_;
91 
98 
99  // pose marker property
108 };
109 } // namespace robot_nav_rviz_plugins
110 
111 #endif // ROBOT_NAV_RVIZ_PLUGINS_PATH_DISPLAY_H
rviz::EnumProperty::getOptionInt
virtual int getOptionInt()
rviz::MessageFilterDisplay
axes.h
robot_nav_rviz_plugins::PathDisplay::destroyObjects
void destroyObjects()
Definition: path_display.cpp:269
robot_nav_rviz_plugins::PathDisplay::updatePoseArrowColor
void updatePoseArrowColor()
Definition: path_display.cpp:240
robot_nav_rviz_plugins::PathDisplay::allocateArrowVector
void allocateArrowVector(std::vector< rviz::Arrow * > &arrow_vect, int num)
Definition: path_display.cpp:135
robot_nav_rviz_plugins::PathDisplay::PoseStyle::NONE
@ NONE
robot_nav_rviz_plugins::PathDisplay::pose_arrow_color_property_
rviz::ColorProperty * pose_arrow_color_property_
Definition: path_display.h:103
robot_nav_rviz_plugins
Several reusable pieces for displaying polygons.
Definition: nav_grid_display.h:60
robot_nav_rviz_plugins::PathDisplay::processMessage
void processMessage(const nav_2d_msgs::Path2D::ConstPtr &msg) override
Definition: path_display.cpp:339
robot_nav_rviz_plugins::PathDisplay::updateStyle
void updateStyle()
Definition: path_display.cpp:156
robot_nav_rviz_plugins::PathDisplay::axes_chain_
std::vector< std::vector< rviz::Axes * > > axes_chain_
Definition: path_display.h:89
robot_nav_rviz_plugins::PathDisplay::style_property_
rviz::EnumProperty * style_property_
Definition: path_display.h:92
robot_nav_rviz_plugins::PathDisplay::allocateAxesVector
void allocateAxesVector(std::vector< rviz::Axes * > &axes_vect, int num)
Definition: path_display.cpp:112
robot_nav_rviz_plugins::PathDisplay::updatePoseArrowGeometry
void updatePoseArrowGeometry()
Definition: path_display.cpp:254
robot_nav_rviz_plugins::PathDisplay::~PathDisplay
virtual ~PathDisplay()
Definition: path_display.cpp:95
int_property.h
robot_nav_rviz_plugins::PathDisplay::pose_axes_radius_property_
rviz::FloatProperty * pose_axes_radius_property_
Definition: path_display.h:102
robot_nav_rviz_plugins::PathDisplay::updateLineWidth
void updateLineWidth()
Definition: path_display.cpp:173
enum_property.h
robot_nav_rviz_plugins::PathDisplay::updateBufferLength
void updateBufferLength()
Definition: path_display.cpp:306
robot_nav_rviz_plugins::PathDisplay::PathDisplay
PathDisplay()
Definition: path_display.cpp:44
robot_nav_rviz_plugins::PathDisplay
Displays a nav_2d_msgs::Path2D message in Rviz.
Definition: path_display.h:54
float_property.h
rviz::ColorProperty
billboard_line.h
rviz::EnumProperty
rviz::FloatProperty
robot_nav_rviz_plugins::PathDisplay::PoseStyle::ARROWS
@ ARROWS
robot_nav_rviz_plugins::PathDisplay::buffer_length_property_
rviz::IntProperty * buffer_length_property_
Definition: path_display.h:96
robot_nav_rviz_plugins::PathDisplay::reset
void reset() override
Definition: path_display.cpp:106
robot_nav_rviz_plugins::PathDisplay::updatePoseAxisGeometry
void updatePoseAxisGeometry()
Definition: path_display.cpp:227
robot_nav_rviz_plugins::PathDisplay::LineStyle::BILLBOARDS
@ BILLBOARDS
robot_nav_rviz_plugins::PathDisplay::line_width_property_
rviz::FloatProperty * line_width_property_
Definition: path_display.h:95
robot_nav_rviz_plugins::PathDisplay::PoseStyle
PoseStyle
Definition: path_display.h:79
robot_nav_rviz_plugins::PathDisplay::updateOffset
void updateOffset()
Definition: path_display.cpp:187
message_filter_display.h
robot_nav_rviz_plugins::PathDisplay::billboard_lines_
std::vector< rviz::BillboardLine * > billboard_lines_
Definition: path_display.h:88
robot_nav_rviz_plugins::PathDisplay::pose_arrow_shaft_length_property_
rviz::FloatProperty * pose_arrow_shaft_length_property_
Definition: path_display.h:104
robot_nav_rviz_plugins::PathDisplay::pose_axes_length_property_
rviz::FloatProperty * pose_axes_length_property_
Definition: path_display.h:101
robot_nav_rviz_plugins::PathDisplay::pose_arrow_shaft_diameter_property_
rviz::FloatProperty * pose_arrow_shaft_diameter_property_
Definition: path_display.h:106
robot_nav_rviz_plugins::PathDisplay::pose_arrow_head_diameter_property_
rviz::FloatProperty * pose_arrow_head_diameter_property_
Definition: path_display.h:107
arrow.h
robot_nav_rviz_plugins::PathDisplay::pose_style_property_
rviz::EnumProperty * pose_style_property_
Definition: path_display.h:100
robot_nav_rviz_plugins::PathDisplay::arrow_chain_
std::vector< std::vector< rviz::Arrow * > > arrow_chain_
Definition: path_display.h:90
robot_nav_rviz_plugins::PathDisplay::pose_arrow_head_length_property_
rviz::FloatProperty * pose_arrow_head_length_property_
Definition: path_display.h:105
robot_nav_rviz_plugins::PathDisplay::LineStyle::LINES
@ LINES
robot_nav_rviz_plugins::PathDisplay::alpha_property_
rviz::FloatProperty * alpha_property_
Definition: path_display.h:94
robot_nav_rviz_plugins::PathDisplay::onInitialize
void onInitialize() override
Definition: path_display.cpp:100
rviz::VectorProperty
robot_nav_rviz_plugins::PathDisplay::updatePoseStyle
void updatePoseStyle()
Definition: path_display.cpp:193
vector_property.h
robot_nav_rviz_plugins::PathDisplay::PoseStyle::AXES
@ AXES
robot_nav_rviz_plugins::PathDisplay::getPoseStyle
PoseStyle getPoseStyle() const
Definition: path_display.h:81
robot_nav_rviz_plugins::PathDisplay::offset_property_
rviz::VectorProperty * offset_property_
Definition: path_display.h:97
robot_nav_rviz_plugins::PathDisplay::color_property_
rviz::ColorProperty * color_property_
Definition: path_display.h:93
color_property.h
robot_nav_rviz_plugins::PathDisplay::manual_objects_
std::vector< Ogre::ManualObject * > manual_objects_
Definition: path_display.h:87
robot_nav_rviz_plugins::PathDisplay::LineStyle
LineStyle
Definition: path_display.h:78
robot_nav_rviz_plugins::PathDisplay::getLineStyle
LineStyle getLineStyle() const
Definition: path_display.h:80
rviz::IntProperty


robot_nav_rviz_plugins
Author(s):
autogenerated on Sun May 18 2025 02:47:50