00001 /* 00002 * GridMapDisplay.h 00003 * 00004 * Created on: Aug 3, 2016 00005 * Author: Philipp Krüsi, Péter Fankhauser 00006 * Institute: ETH Zurich, Autonomous Systems Lab 00007 */ 00008 00009 #pragma once 00010 00011 #ifndef Q_MOC_RUN 00012 #include <grid_map_ros/grid_map_ros.hpp> 00013 #include <grid_map_msgs/GridMap.h> 00014 #include <boost/circular_buffer.hpp> 00015 #include "grid_map_rviz_plugin/modified/message_filter_display.h" 00016 #endif 00017 00018 namespace Ogre { 00019 class SceneNode; 00020 } 00021 00022 namespace rviz { 00023 class BoolProperty; 00024 class ColorProperty; 00025 class FloatProperty; 00026 class IntProperty; 00027 class EnumProperty; 00028 class EditableEnumProperty; 00029 } 00030 00031 namespace grid_map_rviz_plugin { 00032 00033 class GridMapVisual; 00034 class GridMapDisplay : public MessageFilterDisplayMod<grid_map_msgs::GridMap> 00035 { 00036 Q_OBJECT 00037 public: 00038 GridMapDisplay(); 00039 virtual ~GridMapDisplay(); 00040 00041 protected: 00042 virtual void onInitialize(); 00043 00044 virtual void reset(); 00045 00046 private Q_SLOTS: 00047 void updateHistoryLength(); 00048 void updateHeightMode(); 00049 void updateColorMode(); 00050 void updateUseRainbow(); 00051 void updateAutocomputeIntensityBounds(); 00052 void updateVisualization(); 00053 00054 private: 00055 // Callback for incoming ROS messages 00056 void processMessage(const grid_map_msgs::GridMap::ConstPtr& msg); 00057 00058 // Circular buffer for visuals 00059 boost::circular_buffer<boost::shared_ptr<GridMapVisual> > visuals_; 00060 00061 // Property variables 00062 rviz::FloatProperty* alphaProperty_; 00063 rviz::IntProperty* historyLengthProperty_; 00064 rviz::BoolProperty* showGridLinesProperty_; 00065 rviz::EnumProperty* heightModeProperty_; 00066 rviz::EditableEnumProperty* heightTransformerProperty_; 00067 rviz::EnumProperty* colorModeProperty_; 00068 rviz::EditableEnumProperty* colorTransformerProperty_; 00069 rviz::ColorProperty* colorProperty_; 00070 rviz::BoolProperty* useRainbowProperty_; 00071 rviz::BoolProperty* invertRainbowProperty_; 00072 rviz::ColorProperty* minColorProperty_; 00073 rviz::ColorProperty* maxColorProperty_; 00074 rviz::BoolProperty* autocomputeIntensityBoundsProperty_; 00075 rviz::FloatProperty* minIntensityProperty_; 00076 rviz::FloatProperty* maxIntensityProperty_; 00077 }; 00078 00079 } // end namespace grid_map_rviz_plugin