PathDisplay.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Software License Agreement (BSD License) *
3  * Copyright (C) 2016 by George Todoran <george.todoran@tuwien.ac.at> *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions *
7  * are met: *
8  * *
9  * 1. Redistributions of source code must retain the above copyright *
10  * notice, this list of conditions and the following disclaimer. *
11  * 2. Redistributions in binary form must reproduce the above copyright *
12  * notice, this list of conditions and the following disclaimer in *
13  * the documentation and/or other materials provided with the *
14  * distribution. *
15  * 3. Neither the name of the copyright holder nor the names of its *
16  * contributors may be used to endorse or promote products derived *
17  * from this software without specific prior written permission. *
18  * *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
23  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER *
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT *
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY *
29  * WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
30  * POSSIBILITY OF SUCH DAMAGE. *
31  ***************************************************************************/
32 
33 #ifndef PATH_DISPLAY_H
34 #define PATH_DISPLAY_H
35 
36 #ifndef Q_MOC_RUN
37 #include <boost/circular_buffer.hpp>
38 
40 #include <nav_msgs/Path.h>
42 #endif
43 
45 
46 namespace Ogre
47 {
48 class SceneNode;
49 }
50 
51 namespace rviz
52 {
53 class ColorProperty;
54 class EnumProperty;
55 class FloatProperty;
56 class IntProperty;
57 }
58 
59 // All the source in this plugin is in its own namespace. This is not
60 // required but is good practice.
61 namespace tuw_nav_rviz
62 {
63 
64 class PathVisual;
65 
66 // Here we declare our new subclass of rviz::Display. Every display
67 // which can be listed in the "Displays" panel is a subclass of
68 // rviz::Display.
69 class PathDisplay: public rviz::MessageFilterDisplay<nav_msgs::Path>
70 {
71 Q_OBJECT
72 public:
73  // Constructor. pluginlib::ClassLoader creates instances by calling
74  // the default constructor, so make sure you have one.
75  PathDisplay();
76  virtual ~PathDisplay();
77 
78  // Overrides of protected virtual functions from Display. As much
79  // as possible, when Displays are not enabled, they should not be
80  // subscribed to incoming data and should not show anything in the
81  // 3D view. These functions are where these connections are made
82  // and broken.
83 protected:
84  virtual void onInitialize();
85 
86  // A helper to clear this display back to the initial state.
87  virtual void reset();
88 
89  // These Qt slots get connected to signals indicating changes in the user-editable properties.
90 private Q_SLOTS:
91  void updatePathColor();
92  void updateShape();
93  void updatePathScale();
94 
95  void updateOrientColor();
96  void updateOrientShape();
97  void updateOrientScale();
98  void updateOrientDeltaS();
99 
100  void updateHistoryLength();
101 
102  // Function to handle an incoming ROS message.
103 private:
104  void processMessage( const nav_msgs::Path::ConstPtr& msg );
105 
106  // Storage for the list of visuals. It is a circular buffer where
107  // data gets popped from the front (oldest) and pushed to the back (newest)
108  boost::circular_buffer<boost::shared_ptr<PathVisual> > visuals_;
109 
110 
111  // User-editable property variables.
115 
119 
121 
122  enum LineStyle {
124  BILLBOARDS
125  };
126 };
127 
128 } // end namespace tuw_nav_rviz
129 
130 #endif // PATH_DISPLAY_H
131 // %EndTag(FULL_SOURCE)%
rviz::FloatProperty * scale_path_property_
Definition: PathDisplay.h:114
rviz::EnumProperty * shape_property_
Definition: PathDisplay.h:113
rviz::FloatProperty * path_delta_s_orient_property_
Definition: PathDisplay.h:118
rviz::IntProperty * history_length_property_
Definition: PathDisplay.h:120
rviz::ColorProperty * color_path_property_
Definition: PathDisplay.h:112
rviz::FloatProperty * scale_orient_property_
Definition: PathDisplay.h:117
rviz::ColorProperty * color_orient_property_
Definition: PathDisplay.h:116
boost::circular_buffer< boost::shared_ptr< PathVisual > > visuals_
Definition: PathDisplay.h:108


tuw_nav_rviz
Author(s):
autogenerated on Mon Jun 10 2019 15:40:12