GridMapVisual.hpp
Go to the documentation of this file.
1 /*
2  * GridMapVisual.cpp
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 #include <OGRE/OgreMaterial.h>
12 #include <OGRE/OgreSharedPtr.h>
13 
14 #include <grid_map_msgs/GridMap.h>
16 
17 namespace Ogre {
18 class Vector3;
19 class Quaternion;
20 class ManualObject;
21 class ColourValue;
22 }
23 
24 namespace rviz {
25 class BillboardLine;
26 }
27 
28 namespace grid_map_rviz_plugin {
29 
30 // Visualizes a single grid_map_msgs::GridMap message.
32 {
33  public:
34  GridMapVisual(Ogre::SceneManager* sceneManager, Ogre::SceneNode* parentNode);
35  virtual ~GridMapVisual();
36 
37  // Copy the grid map data to map_.
38  void setMessage(const grid_map_msgs::GridMap::ConstPtr& msg);
39  // Compute the visualization of map_.
40  void computeVisualization(float alpha, bool showGridLines, bool flatTerrain, std::string heightLayer, bool flatColor,
41  bool noColor, Ogre::ColourValue meshColor, bool mapLayerColor, std::string colorLayer,
42  bool useRainbow, bool invertRainbow, Ogre::ColourValue minColor, Ogre::ColourValue maxColor,
43  bool autocomputeIntensity, float minIntensity, float maxIntensity);
44 
45  // Set the coordinate frame pose.
46  void setFramePosition(const Ogre::Vector3& position);
47  void setFrameOrientation(const Ogre::Quaternion& orientation);
48 
49  // Get grid map layer names.
50  std::vector<std::string> getLayerNames();
51 
52  private:
53  Ogre::SceneNode* frameNode_;
54  Ogre::SceneManager* sceneManager_;
55 
56  // ManualObject for mesh display.
57  Ogre::ManualObject* manualObject_;
58  Ogre::MaterialPtr material_;
59  std::string materialName_;
60 
61  // Lines for mesh.
63 
64  // Grid map.
66  bool haveMap_;
67 
68  // Helper methods.
69  void normalizeIntensity(float& intensity, float minIntensity, float maxIntensity);
70  Ogre::ColourValue getRainbowColor(float intensity);
71  Ogre::ColourValue getInterpolatedColor(float intensity, Ogre::ColourValue minColor,
72  Ogre::ColourValue maxColor);
73 };
74 
75 } // namespace
boost::shared_ptr< rviz::BillboardLine > meshLines_
Eigen::Vector3d Vector3


grid_map_rviz_plugin
Author(s): Philipp Krüsi, Péter Fankhauser
autogenerated on Tue Jun 25 2019 20:02:28