Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
robot_nav_rviz_plugins::OgrePanel Class Reference

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::Ptrswatches_
 

Detailed Description

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.

Member Typedef Documentation

Definition at line 113 of file ogre_panel.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

Parameters
palette_nameName 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.

Parameters
fmFrame manager with TF info
Returns
Whether the correct frame was found

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.

Parameters
alphaThe desired alpha channel value for the panel. [0.0, 1.0]
draw_behindWhether 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

Parameters
updated_boundsBounds 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.

Parameters
infoNew shape

Definition at line 57 of file ogre_panel.cpp.

Member Data Documentation

std::string robot_nav_rviz_plugins::OgrePanel::current_palette_
protected

Definition at line 158 of file ogre_panel.h.

nav_grid::VectorNavGrid<unsigned char>& robot_nav_rviz_plugins::OgrePanel::data_
protected

Definition at line 151 of file ogre_panel.h.

std::map<std::string, bool> robot_nav_rviz_plugins::OgrePanel::palette_transparency_
protected

Definition at line 157 of file ogre_panel.h.

std::map<std::string, Ogre::TexturePtr> robot_nav_rviz_plugins::OgrePanel::palettes_
protected

Definition at line 156 of file ogre_panel.h.

Ogre::SceneManager& robot_nav_rviz_plugins::OgrePanel::scene_manager_
protected

Definition at line 152 of file ogre_panel.h.

Ogre::SceneNode& robot_nav_rviz_plugins::OgrePanel::scene_node_
protected

Definition at line 153 of file ogre_panel.h.

std::vector<PartialOgrePanel::Ptr> robot_nav_rviz_plugins::OgrePanel::swatches_
protected

Definition at line 154 of file ogre_panel.h.


The documentation for this class was generated from the following files:


robot_nav_rviz_plugins
Author(s):
autogenerated on Sun Jan 10 2021 04:08:58