A collection of Ogre objects for rendering a two-dimensional rectangular plane (such as a map) in rviz. More...
#include <ogre_panel.h>
Classes | |
class | PartialOgrePanel |
Portion of the larger OgrePanel....see above. More... | |
Public Types | |
using | Ptr = std::shared_ptr< OgrePanel > |
Public Member Functions | |
void | addPalette (const NavGridPalette &palette) |
Add a palette with the given name. More... | |
void | clear () |
Clear the panel from the visualization by making it invisible. More... | |
OgrePanel (nav_grid::VectorNavGrid< unsigned char > &data, Ogre::SceneManager &scene_manager, Ogre::SceneNode &scene_node) | |
void | setPalette (const std::string &palette_name) |
Set the palette to use. More... | |
bool | transformMap (rviz::FrameManager &fm) |
Move the map to its proper position and orientation. More... | |
void | updateAlpha (float alpha, bool draw_behind) |
Sets the alpha/draw_behind properties. More... | |
void | updateData (const nav_core2::UIntBounds &updated_bounds) |
Update the panel data within the given bounds. More... | |
void | updateInfo (const nav_grid::NavGridInfo &info) |
Update the location/shape of the grid. More... | |
Protected Attributes | |
std::string | current_palette_ |
nav_grid::VectorNavGrid< unsigned char > & | data_ |
std::map< std::string, bool > | palette_transparency_ |
std::map< std::string, Ogre::TexturePtr > | palettes_ |
Ogre::SceneManager & | scene_manager_ |
Ogre::SceneNode & | scene_node_ |
std::vector< PartialOgrePanel::Ptr > | swatches_ |
A collection of Ogre objects for rendering a two-dimensional rectangular plane (such as a map) in rviz.
If the panel is sufficiently small, it can be done in a single Ogre::ManualObject. However, if it gets too big then Ogre has difficulty rendering such a large texture. Hence, the OgrePanel is divided up into smaller PartialOgrePanels, each of which contains a single ManualObject. See https://github.com/ros-visualization/rviz/pull/1007 for more details.
The pixels in the panel are determined by two things, the NavGrid data and the palette. The data provides a mapping from each cell to a unsigned char (0-255), and the palette provides a mapping from the unsigned char to a RGBA color.
Definition at line 63 of file ogre_panel.h.
using robot_nav_rviz_plugins::OgrePanel::Ptr = std::shared_ptr<OgrePanel> |
Definition at line 113 of file ogre_panel.h.
robot_nav_rviz_plugins::OgrePanel::OgrePanel | ( | nav_grid::VectorNavGrid< unsigned char > & | data, |
Ogre::SceneManager & | scene_manager, | ||
Ogre::SceneNode & | scene_node | ||
) |
Definition at line 51 of file ogre_panel.cpp.
void robot_nav_rviz_plugins::OgrePanel::addPalette | ( | const NavGridPalette & | palette | ) |
Add a palette with the given name.
Definition at line 131 of file ogre_panel.cpp.
void robot_nav_rviz_plugins::OgrePanel::clear | ( | ) |
Clear the panel from the visualization by making it invisible.
Definition at line 215 of file ogre_panel.cpp.
void robot_nav_rviz_plugins::OgrePanel::setPalette | ( | const std::string & | palette_name | ) |
Set the palette to use.
palette_name | Name of the pallete (needs to be added previously with addPalette) |
Definition at line 165 of file ogre_panel.cpp.
bool robot_nav_rviz_plugins::OgrePanel::transformMap | ( | rviz::FrameManager & | fm | ) |
Move the map to its proper position and orientation.
fm | Frame manager with TF info |
Definition at line 223 of file ogre_panel.cpp.
void robot_nav_rviz_plugins::OgrePanel::updateAlpha | ( | float | alpha, |
bool | draw_behind | ||
) |
Sets the alpha/draw_behind properties.
alpha | The desired alpha channel value for the panel. [0.0, 1.0] |
draw_behind | Whether it should be drawn before (behind) the other maps |
Definition at line 175 of file ogre_panel.cpp.
void robot_nav_rviz_plugins::OgrePanel::updateData | ( | const nav_core2::UIntBounds & | updated_bounds | ) |
Update the panel data within the given bounds.
Assumes underlying data object's values have already changed and this class just updates the Ogre objects
updated_bounds | Bounds of the grid that have been updated |
Definition at line 94 of file ogre_panel.cpp.
void robot_nav_rviz_plugins::OgrePanel::updateInfo | ( | const nav_grid::NavGridInfo & | info | ) |
Update the location/shape of the grid.
info | New shape |
Definition at line 57 of file ogre_panel.cpp.
|
protected |
Definition at line 158 of file ogre_panel.h.
|
protected |
Definition at line 151 of file ogre_panel.h.
|
protected |
Definition at line 157 of file ogre_panel.h.
|
protected |
Definition at line 156 of file ogre_panel.h.
|
protected |
Definition at line 152 of file ogre_panel.h.
|
protected |
Definition at line 153 of file ogre_panel.h.
|
protected |
Definition at line 154 of file ogre_panel.h.