habitat.sims.habitat_simulator.debug_visualizer module

The DebugVisualizer (DBV) module provides a singleton class for quickly generating custom debug RGB images from an already instantiated Simulator instance. DebugObservation provides a wrapper class for accessing, saving, showing, and manipulating numpy image matrices with PIL. The module also provides some helper functions for highlighting objects with DebugLineRender and stitching images together into a matrix of images.

Classes

class DebugObservation
Observation wrapper to provide a simple interface for managing debug observations and caching the image.
class DebugVisualizer
Support class for simple visual debugging of a Simulator instance. Assumes the default agent (0) is a camera (i.e. there exists an RGB sensor coincident with agent 0 transformation).

Functions

def dblr_draw_bb(debug_line_render: habitat_sim._ext.habitat_sim_bindings.DebugLineRender, bb: _magnum.Range3D, transform: typing.Optional[_magnum.Matrix4] = None, color: typing.Optional[_magnum.Color4] = None) -> None
Draw an optionally transformed bounding box with the DebugLineRender interface.
def draw_object_highlight(obj: typing.Union[habitat_sim._ext.habitat_sim_bindings.ManagedRigidObject, habitat_sim._ext.habitat_sim_bindings.ManagedArticulatedObject], debug_line_render: habitat_sim._ext.habitat_sim_bindings.DebugLineRender, camera_transform: _magnum.Matrix4, color: typing.Optional[_magnum.Color4] = None) -> None
Draw a circle around the object to highlight it. The circle normal is oriented toward the camera_transform.
def project_point(render_camera: habitat_sim._ext.habitat_sim_bindings.CameraSensor, point: _magnum.Vector3) -> _magnum.Vector2
Project a 3D point into the render_camera’s 2D screen space.
def stitch_image_matrix(images: typing.List[PIL.Image.Image], num_col: int = 8)
Stitch together a set of images into a single image matrix.

Function documentation

def habitat.sims.habitat_simulator.debug_visualizer.dblr_draw_bb(debug_line_render: habitat_sim._ext.habitat_sim_bindings.DebugLineRender, bb: _magnum.Range3D, transform: typing.Optional[_magnum.Matrix4] = None, color: typing.Optional[_magnum.Color4] = None) -> None

Draw an optionally transformed bounding box with the DebugLineRender interface.

Parameters
debug_line_render The DebugLineRender instance.
bb The local bounding box to draw.
transform The local to global transformation to apply to the local bb.
color Optional color for the lines. Default is magenta.

def habitat.sims.habitat_simulator.debug_visualizer.draw_object_highlight(obj: typing.Union[habitat_sim._ext.habitat_sim_bindings.ManagedRigidObject, habitat_sim._ext.habitat_sim_bindings.ManagedArticulatedObject], debug_line_render: habitat_sim._ext.habitat_sim_bindings.DebugLineRender, camera_transform: _magnum.Matrix4, color: typing.Optional[_magnum.Color4] = None) -> None

Draw a circle around the object to highlight it. The circle normal is oriented toward the camera_transform.

Parameters
obj The ManagedObject
debug_line_render The DebugLineRender instance for the Simulator.
camera_transform The Matrix4 transform of the camera. Used to orient the circle normal.
color The color of the circle. Default magenta.

def habitat.sims.habitat_simulator.debug_visualizer.project_point(render_camera: habitat_sim._ext.habitat_sim_bindings.CameraSensor, point: _magnum.Vector3) -> _magnum.Vector2

Project a 3D point into the render_camera’s 2D screen space.

Parameters
render_camera The RenderCamera object. E.g. sensor._sensor_object.render_camera
point The 3D global point to project.

def habitat.sims.habitat_simulator.debug_visualizer.stitch_image_matrix(images: typing.List[PIL.Image.Image], num_col: int = 8)

Stitch together a set of images into a single image matrix.

Parameters
images The PIL.Image.Image objects
num_col The number of columns in the matrix
Returns A DebugObservation wrapper with the stitched image.