robosuite.renderers.nvisii package


robosuite.renderers.nvisii.nvisii_renderer module

class robosuite.renderers.nvisii.nvisii_renderer.NVISIIRenderer(env, img_path='images/', width=500, height=500, spp=256, use_noise=False, debug_mode=False, video_mode=False, video_path='videos/', video_name='robosuite_video_0.mp4', video_fps=60, verbose=1, vision_modalities=None)

Bases: robosuite.renderers.base.Renderer


Deinitializes the nvisii rendering environment


Get the pixel observations from the given renderer


numpy array representing pixels of renderer

Return type


randomize_colors(N, bright=True)

Modified from Generate random colors. To get visually distinct colors, generate them in HSV space then convert to RGB.


Renders an image of the NVISII renderer


render_type (string, optional) – Type of file to save as. Defaults to ‘png’


Reset the renderer with initial states for environment

segmentation_to_rgb(seg_im, random_colors=False)

Helper function to visualize segmentations as RGB frames. NOTE: assumes that geom IDs go up to 255 at most - if not, multiple geoms might be assigned to the same color.

set_camera_pos_quat(pos, quat)

Checks if one of the tags in body tags in the name


name (string) – Name of component


Updates the states for the wrapper given a certain action


action (np-array) – The action the robot should take

robosuite.renderers.nvisii.nvisii_utils module

robosuite.renderers.nvisii.nvisii_utils.load_object(geom, geom_name, geom_type, geom_quat, geom_pos, geom_size, geom_scale, geom_rgba, geom_tex_name, geom_tex_file, class_id, meshes)

Function that initializes the meshes in the memory.

  • geom (XML element) – Object in XML file to load

  • geom_name (str) – Name for the object.

  • geom_type (str) – Type of the object. Types include “box”, “cylinder”, or “mesh”.

  • geom_quat (array) – Quaternion (wxyz) of the object.

  • geom_pos (array) – Position of the object.

  • geom_size (array) – Size of the object.

  • geom_scale (array) – Scale of the object.

  • geom_rgba (array) – Color of the object. This is only used if the geom type is not a mesh and there is no specified material.

  • geom_tex_name (str) – Name of the texture for the object

  • geom_tex_file (str) – File of the texture for the object

  • class_id (int) – Class id for the component

  • meshes (dict) – Meshes for the object

robosuite.renderers.nvisii.parser module

class robosuite.renderers.nvisii.parser.Components(obj, geom_index, element_id, parent_body_name, geom_pos, geom_quat, dynamic)

Bases: tuple

property dynamic

Alias for field number 6

property element_id

Alias for field number 2

property geom_index

Alias for field number 1

property geom_pos

Alias for field number 4

property geom_quat

Alias for field number 5

property obj

Alias for field number 0

property parent_body_name

Alias for field number 3

class robosuite.renderers.nvisii.parser.Parser(renderer, env, segmentation_type)

Bases: robosuite.renderers.base_parser.BaseParser


Create class name to index mapping for both semantic and instance segmentation.

get_class_id(geom_index, element_id)

Given index of the geom object get the class id based on self.segmentation type.


Iterate through each goemetry and load it in the NVISII renderer.


Parse all materials and use texture mapping to initialize materials


Create mapping of meshes.


Parse and load all textures and store them

tag_in_name(name, tags)

Checks if one of the tags in body tags in the name

  • name (str) – Name of geom element.

  • tags (array) – List of keywords to check from.

Module contents