Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #pragma once
00010
00011 #include <OGRE/OgreMaterial.h>
00012 #include <OGRE/OgreSharedPtr.h>
00013
00014 #include <grid_map_msgs/GridMap.h>
00015 #include <grid_map_core/GridMap.hpp>
00016
00017 namespace Ogre {
00018 class Vector3;
00019 class Quaternion;
00020 class ManualObject;
00021 class ColourValue;
00022 }
00023
00024 namespace rviz {
00025 class BillboardLine;
00026 }
00027
00028 namespace grid_map_rviz_plugin {
00029
00030
00031 class GridMapVisual
00032 {
00033 public:
00034 GridMapVisual(Ogre::SceneManager* sceneManager, Ogre::SceneNode* parentNode);
00035 virtual ~GridMapVisual();
00036
00037
00038 void setMessage(const grid_map_msgs::GridMap::ConstPtr& msg);
00039
00040 void computeVisualization(float alpha, bool showGridLines, bool flatTerrain, std::string heightLayer, bool flatColor,
00041 bool noColor, Ogre::ColourValue meshColor, bool mapLayerColor, std::string colorLayer,
00042 bool useRainbow, bool invertRainbow, Ogre::ColourValue minColor, Ogre::ColourValue maxColor,
00043 bool autocomputeIntensity, float minIntensity, float maxIntensity);
00044
00045
00046 void setFramePosition(const Ogre::Vector3& position);
00047 void setFrameOrientation(const Ogre::Quaternion& orientation);
00048
00049
00050 std::vector<std::string> getLayerNames();
00051
00052 private:
00053 Ogre::SceneNode* frameNode_;
00054 Ogre::SceneManager* sceneManager_;
00055
00056
00057 Ogre::ManualObject* manualObject_;
00058 Ogre::MaterialPtr material_;
00059 std::string materialName_;
00060
00061
00062 boost::shared_ptr<rviz::BillboardLine> meshLines_;
00063
00064
00065 grid_map::GridMap map_;
00066 bool haveMap_;
00067
00068
00069 void normalizeIntensity(float& intensity, float minIntensity, float maxIntensity);
00070 Ogre::ColourValue getRainbowColor(float intensity);
00071 Ogre::ColourValue getInterpolatedColor(float intensity, Ogre::ColourValue minColor,
00072 Ogre::ColourValue maxColor);
00073 };
00074
00075 }