nav_grid_display.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2020, Locus Robotics
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef ROBOT_NAV_RVIZ_PLUGINS_NAV_GRID_DISPLAY_H
36 #define ROBOT_NAV_RVIZ_PLUGINS_NAV_GRID_DISPLAY_H
37 
38 #ifndef Q_MOC_RUN
39 #include <boost/thread/thread.hpp>
40 #include <OgreTexture.h>
41 #include <OgreMaterial.h>
42 #include <OgreSharedPtr.h>
43 #endif
44 
50 #include <rviz/display.h>
51 
53 
56 #include <pluginlib/class_loader.h>
57 
58 #include <string>
59 #include <vector>
60 
62 {
73 {
74 Q_OBJECT
75 public:
85  explicit NavGridDisplay(const std::string& data_type, bool include_ignore_property = false);
86  virtual ~NavGridDisplay();
87 
92  void reset() override;
93  void setTopic(const QString &topic, const QString &datatype) override;
94  void update(float wall_dt, float ros_dt) override;
99 Q_SIGNALS:
103  void mapUpdated(const nav_core2::UIntBounds& updated_bounds);
104 
105 protected Q_SLOTS:
110  void updateAlpha();
111  void updateTopic();
112  void updatePalette();
113  void showMap(const nav_core2::UIntBounds& updated_bounds);
114  virtual void updateIgnoreType();
115  virtual void updateIgnore() {}
120 protected:
121  enum struct IgnoreType {NONE, VALUE, LIMIT};
123 
128  void onInitialize() override;
129  void fixedFrameChanged() override;
130  void onEnable() override;
131  void onDisable() override;
141  void subscribe();
142 
147  virtual void onSubscribe(const std::string& topic) {}
148 
154  void unsubscribe();
155 
159  virtual void onUnsubscribe() {}
160 
164  void clear();
165 
169  void transformMap();
170 
171  // The Actual Display Object
172  // Note it has to be a pointer for lazy initialization
174 
175  // Data
178 
179  // Non-editiable properties
183 
184  // Editable Properties
190 
191  // Properties only used by some subclasses (see constructor)
194 
195  // Color Scheme Management
196  std::vector<std::string> color_scheme_names_;
198 };
199 
200 } // namespace robot_nav_rviz_plugins
201 
202 #endif // ROBOT_NAV_RVIZ_PLUGINS_NAV_GRID_DISPLAY_H
void showMap(const nav_core2::UIntBounds &updated_bounds)
void clear()
Clear the data and remove the objects from the screen.
void setTopic(const QString &topic, const QString &datatype) override
void unsubscribe()
Called to trigger unsubscribing.
std::vector< std::string > color_scheme_names_
virtual void onSubscribe(const std::string &topic)
Actual subscription logic, called by subscribe.
std::shared_ptr< OgrePanel > Ptr
Definition: ogre_panel.h:113
rviz::RosTopicProperty * topic_property_
nav_grid::VectorNavGrid< unsigned char > panel_data_
void update(float wall_dt, float ros_dt) override
Several reusable pieces for displaying polygons.
NavGridDisplay(const std::string &data_type, bool include_ignore_property=false)
Constructor for the display.
virtual void onUnsubscribe()
Actual unsubscription logic, called by unsubscribe.
void mapUpdated(const nav_core2::UIntBounds &updated_bounds)
Custom signal emitted when new map data is received.
void transformMap()
Put the map in its proper place.
void subscribe()
Called to trigger subscription, handles empty topics setting status.
pluginlib::ClassLoader< NavGridPalette > palette_loader_
Displays a nav_grid (of unspecified type) along the XY plane.
virtual int getOptionInt()


robot_nav_rviz_plugins
Author(s):
autogenerated on Sun Jan 10 2021 04:08:58