11 #include <OGRE/OgreMaterial.h> 12 #include <OGRE/OgreSharedPtr.h> 14 #include <grid_map_msgs/GridMap.h> 33 using MaskArray = Eigen::Array<bool, Eigen::Dynamic, Eigen::Dynamic>;
34 using ColorArray = Eigen::Array<Ogre::ColourValue, Eigen::Dynamic, Eigen::Dynamic>;
37 GridMapVisual(Ogre::SceneManager* sceneManager, Ogre::SceneNode* parentNode);
41 void setMessage(
const grid_map_msgs::GridMap::ConstPtr& msg);
44 void computeVisualization(
float alpha,
bool showGridLines,
bool flatTerrain, std::string heightLayer,
bool flatColor,
bool noColor,
45 Ogre::ColourValue meshColor,
bool mapLayerColor, std::string colorLayer, std::string
colorMap,
bool useColorMap,
46 bool invertColorMap, Ogre::ColourValue minColor, Ogre::ColourValue maxColor,
bool autocomputeIntensity,
47 float minIntensity,
float maxIntensity,
float gridLineThickness,
int gridCellDecimation);
50 void setFramePosition(
const Ogre::Vector3& position);
51 void setFrameOrientation(
const Ogre::Quaternion& orientation);
54 std::vector<std::string> getLayerNames();
57 enum class ColoringMethod { FLAT, COLOR_LAYER, INTENSITY_LAYER_MANUAL, INTENSITY_LAYER_COLORMAP, INTENSITY_LAYER_INVERTED_COLORMAP };
77 static constexpr
double warningMessageThrottlePeriod_{10.0};
83 void initializeAndBeginManualObject(
size_t nVertices);
100 ColorArray computeColorValues(MatrixConstRef heightData, MatrixConstRef colorData,
101 ColoringMethod coloringMethod, std::string
colorMap, Ogre::ColourValue flatColor,
102 double minIntensity,
double maxIntensity,
bool autocomputeIntensity, Ogre::ColourValue minColor,
103 Ogre::ColourValue maxColor);
113 void initializeMeshLines(
size_t cols,
size_t rows,
double resolution,
double alpha,
double lineWidth);
120 MaskArray computeIsValidMask(std::vector<std::string> basicLayers);
127 void printMissingBasicLayers(
const std::vector<std::string>& basicLayers)
const;
136 static void normalizeIntensity(
float& intensity,
float minIntensity,
float maxIntensity);
144 static Ogre::ColourValue getRainbowColor(
float intensity);
153 Ogre::ColourValue getInterpolatedColor(
float intensity, Ogre::ColourValue minColor, Ogre::ColourValue maxColor);
171 std::vector<Ogre::Vector3> computeMeshLineVertices(
int i,
int j,
int gridCellDecimation,
bool isNthRow,
bool isNthCol,
bool isLastRow,
173 const Eigen::ArrayXXf& heightOrFlatData,
const MaskArray& isValid)
const;
boost::shared_ptr< rviz::BillboardLine > meshLines_
Ogre::SceneManager * sceneManager_
const std::map< std::string, std::vector< std::vector< float > > > colorMap
Ogre::MaterialPtr material_
Ogre::ManualObject * manualObject_
std::string materialName_
Eigen::Ref< const grid_map::Matrix > MatrixConstRef
Eigen::Array< bool, Eigen::Dynamic, Eigen::Dynamic > MaskArray
Ogre::SceneNode * frameNode_
Eigen::Array< Ogre::ColourValue, Eigen::Dynamic, Eigen::Dynamic > ColorArray