16 #include <OGRE/OgreSceneNode.h> 17 #include <OGRE/OgreSceneManager.h> 33 qRegisterMetaType<grid_map_msgs::GridMap::ConstPtr>(
"grid_map_msgs::GridMap::ConstPtr");
36 "0 is fully transparent, 1.0 is fully opaque.",
this,
40 "Number of prior grid maps to display.",
this,
52 "Select the transformer to use to set the height.",
58 "Height Layer",
"elevation",
"Select the grid map layer to compute the height.",
this,
62 "Select the transformer to use to set the color.",
70 "Color Layer",
"elevation",
"Select the grid map layer to compute the color.",
this,
74 "ColorMap",
"default",
"Select the colormap to be used.",
this,
78 "Color to draw the mesh.",
this,
84 "Whether to use a colormap or to interpolate between two colors.",
this,
88 "Invert ColorMap",
false,
89 "Whether to invert the colormap colors.",
this,
93 "Min Color", QColor(0, 0, 0),
"Color to assign to cells with the minimum intensity. " 94 "Actual color is interpolated between this and Max Color.",
99 "Max Color", QColor(255, 255, 255),
"Color to assign to cells with the maximum intensity. " 100 "Actual color is interpolated between Min Color and this.",
105 "Autocompute Intensity Bounds",
true,
106 "Whether to automatically compute the intensity min/max values.",
this,
110 "Min Intensity", 0.0,
111 "Minimum possible intensity value, used to interpolate from Min Color to Max Color.",
this,
116 "Max Intensity", 10.0,
117 "Maximum possible intensity value, used to interpolate from Min Color to Max Color.",
this,
235 for (
size_t i = 0; i <
visuals_.size(); i++) {
236 visuals_[i]->computeVisualization(alpha, showGridLines, flatTerrain, heightLayer, flatColor, noColor, meshColor, mapLayerColor,
237 colorLayer, colorMap, useColorMap, invertColorMap, minColor, maxColor, autocomputeIntensity, minIntensity,
238 maxIntensity, gridLineThickness, gridCellDecimation);
255 Ogre::Quaternion orientation;
256 Ogre::Vector3 position;
258 position, orientation)) {
259 ROS_DEBUG(
"Error transforming from frame '%s' to frame '%s'", msg->info.header.frame_id.c_str(),
271 visual->setMessage(msg);
272 visual->setFramePosition(position);
273 visual->setFrameOrientation(orientation);
286 std::vector<std::string> layer_names = visual->getLayerNames();
289 for (
size_t i = 0; i < layer_names.size(); i++) {
rviz::ColorProperty * colorProperty_
rviz::BoolProperty * showGridLinesProperty_
static std::vector< std::string > getColorMapNames()
rviz::EditableEnumProperty * colorMapProperty_
rviz::ColorProperty * minColorProperty_
DisplayContext * context_
rviz::FloatProperty * alphaProperty_
virtual void clearOptions()
virtual ~GridMapDisplay()
rviz::EnumProperty * colorModeProperty_
void updateVisualization()
rviz::IntProperty * historyLengthProperty_
void onInitialize() override
void onProcessMessage(const grid_map_msgs::GridMap::ConstPtr &msg)
virtual void onInitialize()
Ogre::ColourValue getOgreColor() const
void updateAutocomputeIntensityBounds()
const std::map< std::string, std::vector< std::vector< float > > > colorMap
void addOptionStd(const std::string &option)
std::atomic< bool > isEnabled_
rviz::BoolProperty * autocomputeIntensityBoundsProperty_
Ogre::SceneNode * scene_node_
rviz::BoolProperty * useColorMapProperty_
std::string getStdString()
void onDisable() override
void updateHistoryLength()
rviz::ColorProperty * maxColorProperty_
rviz::FloatProperty * gridLinesThicknessProperty_
virtual void addOption(const QString &option, int value=0)
rviz::IntProperty * gridCellDecimationProperty_
void updateColorMapList()
void process(const grid_map_msgs::GridMap::ConstPtr &msg)
virtual FrameManager * getFrameManager() const=0
virtual int getInt() const
BoolProperty(const QString &name=QString(), bool default_value=false, const QString &description=QString(), Property *parent=nullptr, const char *changed_slot=nullptr, QObject *receiver=nullptr)
virtual Ogre::SceneManager * getSceneManager() const=0
virtual void setHidden(bool hidden)
rviz::EnumProperty * heightModeProperty_
virtual float getFloat() const
bool getTransform(const Header &header, Ogre::Vector3 &position, Ogre::Quaternion &orientation)
rviz::FloatProperty * minIntensityProperty_
rviz::EditableEnumProperty * colorTransformerProperty_
rviz::BoolProperty * invertColorMapProperty_
virtual bool getBool() const
virtual int getOptionInt()
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
void processMessage(const grid_map_msgs::GridMap::ConstPtr &msg)
boost::circular_buffer< boost::shared_ptr< GridMapVisual > > visuals_
rviz::FloatProperty * maxIntensityProperty_
rviz::EditableEnumProperty * heightTransformerProperty_