Drake
RgbdRenderer Class Referenceabstract

Abstract interface of RGB-D renderers, which render RGB, depth and label images using VisualElement. More...

#include <systems/sensors/rgbd_renderer.h>

Inheritance diagram for RgbdRenderer:
[legend]

Public Types

using VisualIndex = TypeSafeIndex< class VisualTag >
 Represents indices for visual elements. More...
 

Public Member Functions

 RgbdRenderer (const RenderingConfig &config, const Eigen::Isometry3d &X_WC=Eigen::Isometry3d::Identity())
 A constructor for RgbdRenderer. More...
 
virtual ~RgbdRenderer ()
 
void AddFlatTerrain ()
 Adds a flat terrain in the rendering scene. More...
 
optional< VisualIndexRegisterVisual (const DrakeShapes::VisualElement &visual, int body_id)
 Registers a visual element to a rigid body and returns the ID of the visual element. More...
 
void UpdateVisualPose (const Eigen::Isometry3d &X_WV, int body_id, VisualIndex visual_id) const
 Updates the pose of a visual with given pose X_WV. More...
 
void UpdateViewpoint (const Eigen::Isometry3d &X_WC) const
 Updates renderer's camera viewpoint with given pose X_WC. More...
 
void RenderColorImage (ImageRgba8U *color_image_out) const
 Renders and outputs the rendered color image. More...
 
void RenderDepthImage (ImageDepth32F *depth_image_out) const
 Renders and outputs the rendered depth image. More...
 
void RenderLabelImage (ImageLabel16I *label_image_out) const
 Renders and outputs the rendered label image. More...
 
const RenderingConfigconfig () const
 Returns the configuration object of this renderer. More...
 
const ColorPalettecolor_palette () const
 Returns the color palette of this renderer. More...
 
Does not allow copy, move, or assignment
 RgbdRenderer (const RgbdRenderer &)=delete
 
RgbdRendereroperator= (const RgbdRenderer &)=delete
 
 RgbdRenderer (RgbdRenderer &&)=delete
 
RgbdRendereroperator= (RgbdRenderer &&)=delete
 

Detailed Description

Abstract interface of RGB-D renderers, which render RGB, depth and label images using VisualElement.

The coordinate system of RgbdRenderer's viewpoint R is X-right, Y-down and Z-forward with respect to the rendered images.

Output image format:

  • RGB (ImageRgba8U) : the RGB image has four channels in the following order: red, green, blue and alpha. Each channel is represented by a uint8_t.
  • Depth (ImageDepth32F) : the depth image has a depth channel represented by a float. For a point in space P, the value stored in the depth channel holds the Z-component of the position vector p_RP. Note that this is different from the range data used by laser range finders (like that provided by DepthSensor) in which the depth value represents the distance from the sensor origin to the object's surface.
  • Label (ImageLabel16I) : the label image has single channel represented by a int16_t. The value stored in the channel holds a model ID which corresponds to an object in the scene. For the pixels corresponding to no body, namely the sky and the flat terrain, we assign Label::kNoBody and Label::kFlatTerrain, respectively.

Member Typedef Documentation

using VisualIndex = TypeSafeIndex<class VisualTag>

Represents indices for visual elements.

Constructor & Destructor Documentation

RgbdRenderer ( const RgbdRenderer )
delete
RgbdRenderer ( RgbdRenderer &&  )
delete
RgbdRenderer ( const RenderingConfig config,
const Eigen::Isometry3d &  X_WC = Eigen::Isometry3d::Identity() 
)

A constructor for RgbdRenderer.

Parameters
configConfigurations of the renderer. See RenderingConfig.
X_WCThe initial pose of the renderer's unique camera viewpoint C in the world coordinate system. The camera pose C can be updated by calling UpdateViewpoint later on. Default value: Identity. TODO(thduynguyen, kunimatsu-tri): Handle multiple viewpoints, e.g. for stereo depth camera?
~RgbdRenderer ( )
virtual

Member Function Documentation

void AddFlatTerrain ( )

Adds a flat terrain in the rendering scene.

const ColorPalette & color_palette ( ) const

Returns the color palette of this renderer.

const RenderingConfig & config ( ) const

Returns the configuration object of this renderer.

RgbdRenderer& operator= ( RgbdRenderer &&  )
delete
RgbdRenderer& operator= ( const RgbdRenderer )
delete
optional< RgbdRenderer::VisualIndex > RegisterVisual ( const DrakeShapes::VisualElement visual,
int  body_id 
)

Registers a visual element to a rigid body and returns the ID of the visual element.

The element is uniquely identified using body_id and visual_id.

Parameters
visualA visual element to be registered. See VisualElement for more detail.
body_idThe ID of a rigid body that you want a visual to be associated with. Note that you can associate more than one visual with a rigid body.
Returns
visual_id A local visual ID associated with given body_id. nullopt will be returned if visual contains an unsupported shape. We assume visual_id will be used together with body_id when you call UpdateVisualPose() later.
void RenderColorImage ( ImageRgba8U color_image_out) const

Renders and outputs the rendered color image.

Parameters
color_image_outThe rendered color image.
void RenderDepthImage ( ImageDepth32F depth_image_out) const

Renders and outputs the rendered depth image.

Parameters
depth_image_outThe rendered depth image.
void RenderLabelImage ( ImageLabel16I label_image_out) const

Renders and outputs the rendered label image.

Parameters
label_image_outThe rendered label image.
void UpdateViewpoint ( const Eigen::Isometry3d &  X_WC) const

Updates renderer's camera viewpoint with given pose X_WC.

Parameters
X_WCThe pose of renderer's camera viewpoint in the world coordinate system.
void UpdateVisualPose ( const Eigen::Isometry3d &  X_WV,
int  body_id,
VisualIndex  visual_id 
) const

Updates the pose of a visual with given pose X_WV.

Parameters
X_WVThe pose of a visual in the world coordinate system.
body_idThe ID of a rigid body that the visual you want to update is associated with.
visual_idThe local ID of a visual that is associated with a rigid body and you want to update.

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