GridMapDisplay.hpp
Go to the documentation of this file.
1 /*
2  * GridMapDisplay.h
3  *
4  * Created on: Aug 3, 2016
5  * Author: Philipp Krüsi, Péter Fankhauser
6  * Institute: ETH Zurich, ANYbotics
7  */
8 
9 #pragma once
10 
11 #ifndef Q_MOC_RUN
13 #include <grid_map_msgs/GridMap.h>
14 #include <boost/circular_buffer.hpp>
15 // The following replaces <rviz/message_filter_display.h>
17 #endif
18 
19 namespace Ogre {
20 class SceneNode;
21 }
22 
23 namespace rviz {
24 class BoolProperty;
25 class ColorProperty;
26 class FloatProperty;
27 class IntProperty;
28 class EnumProperty;
29 class EditableEnumProperty;
30 }
31 
32 namespace grid_map_rviz_plugin {
33 
34 class GridMapVisual;
35 class GridMapDisplay : public MessageFilterDisplay<grid_map_msgs::GridMap>
36 {
37 Q_OBJECT
38  public:
40  virtual ~GridMapDisplay();
41 
42  protected:
43  virtual void onInitialize();
44 
45  virtual void onEnable();
46 
47  virtual void onDisable();
48 
49  virtual void reset();
50 
51  Q_SIGNALS:
52  // Signal to ensure that the rendering happens in the ui thread.
53  void process(const grid_map_msgs::GridMap::ConstPtr& msg);
54 
55  private Q_SLOTS:
56  void updateHistoryLength();
57  void updateHeightMode();
58  void updateColorMode();
59  void updateUseColorMap();
60  void updateAutocomputeIntensityBounds();
61  void updateVisualization();
62  void updateColorMapList();
63  void updateGridLines();
64  // Slot to ensure that the rendering happens in the ui thread.
65  void onProcessMessage(const grid_map_msgs::GridMap::ConstPtr& msg);
66 
67  private:
68  // Callback for incoming ROS messages
69  void processMessage(const grid_map_msgs::GridMap::ConstPtr& msg);
70 
71  // Flag to ensure that after the reset the scene is not updated again.
72  std::atomic<bool> isEnabled_{true};
73 
74  // Circular buffer for visuals
75  boost::circular_buffer<boost::shared_ptr<GridMapVisual> > visuals_;
76 
77  // Property variables
96 };
97 
98 } // end namespace grid_map_rviz_plugin
rviz::BoolProperty * showGridLinesProperty_
rviz::EditableEnumProperty * colorMapProperty_
rviz::ColorProperty * minColorProperty_
Display subclass using a tf2_ros::MessageFilter, templated on the ROS message type.
rviz::IntProperty * historyLengthProperty_
rviz::BoolProperty * autocomputeIntensityBoundsProperty_
rviz::BoolProperty * useColorMapProperty_
rviz::ColorProperty * maxColorProperty_
rviz::FloatProperty * gridLinesThicknessProperty_
rviz::IntProperty * gridCellDecimationProperty_
rviz::EnumProperty * heightModeProperty_
rviz::FloatProperty * minIntensityProperty_
rviz::EditableEnumProperty * colorTransformerProperty_
rviz::BoolProperty * invertColorMapProperty_
boost::circular_buffer< boost::shared_ptr< GridMapVisual > > visuals_
rviz::FloatProperty * maxIntensityProperty_
rviz::EditableEnumProperty * heightTransformerProperty_


grid_map_rviz_plugin
Author(s): Philipp Krüsi , Péter Fankhauser
autogenerated on Wed Jul 5 2023 02:23:55