igibson.render.mesh_renderer package

Submodules

igibson.render.mesh_renderer.get_available_devices module

igibson.render.mesh_renderer.get_available_devices.get_available_devices()

Find available devices to run EGL on. It will return the minor numbers, The minor number for the device is such that the Nvidia device node file for each GPU will have the form /dev/nvidia[minor number]. Avail- able only on Linux platform.

Returns

Minor number

igibson.render.mesh_renderer.get_available_devices.get_cuda_device(minor_idx)

Get the device index to use in pytorch

The minor number for the device is such that the Nvidia device node file for each GPU will have the form /dev/nvidia[minor number]. Avail- able only on Linux platform.

Parameters

minor_idx – Minor index for a GPU

Returns

index to use in torch.cuda.device()

igibson.render.mesh_renderer.instances module

class igibson.render.mesh_renderer.instances.Instance(object, id, pybullet_uuid, class_id, pose_trans, pose_rot, dynamic, softbody, use_pbr=True, use_pbr_mapping=True, shadow_caster=True)

Bases: object

Instance is one instance of a visual object. One visual object can have multiple instances to save memory.

dump()

Dump vertex and face information

get_pose_in_camera()

Get instance pose in camera reference frame

render(shadow_pass=0)

Render this instance shadow_pass = 0: normal rendering mode, disable shadow shadow_pass = 1: enable_shadow, rendering depth map from light space shadow_pass = 2: use rendered depth map to calculate shadow

Parameters

shadow_pass – shadow pass mode

set_position(pos)

Set position

Parameters

pos – position

set_rotation(rot)

Set orientation

Parameters

rot – rotation matrix

class igibson.render.mesh_renderer.instances.InstanceGroup(objects, id, link_ids, pybullet_uuid, class_id, poses_trans, poses_rot, dynamic, robot=None, use_pbr=True, use_pbr_mapping=True, shadow_caster=True)

Bases: object

InstanceGroup is a set of visual objects. It is grouped together because they are kinematically connected. Robots and articulated objects are represented as instance groups.

dump()

Dump vertex and face information

get_pose_in_camera()

Get instance group pose in camera reference frame

render(shadow_pass=0)

Render this instance group shadow_pass = 0: normal rendering mode, disable shadow shadow_pass = 1: enable_shadow, rendering depth map from light space shadow_pass = 2: use rendered depth map to calculate shadow

Parameters

shadow_pass – shadow pass mode

set_position(pos)

Set positions for each part of this InstanceGroup

Parameters

pos – positions

set_position_for_part(pos, j)

Set positions for one part of this InstanceGroup

Parameters
  • pos – position

  • j – part index

set_rotation(rot)

Set rotations for each part of this InstanceGroup

Parameters

rot – rotation matrix

set_rotation_for_part(rot, j)

Set rotations for one part of this InstanceGroup

Parameters
  • rot – rotation matrix

  • j – part index

class igibson.render.mesh_renderer.instances.Robot(*args, **kwargs)

Bases: igibson.render.mesh_renderer.instances.InstanceGroup

A specfial type of InstanceGroup used for Robots

igibson.render.mesh_renderer.materials module

class igibson.render.mesh_renderer.materials.Material(material_type='color', kd=[0.5, 0.5, 0.5], texture_id=None, metallic_texture_id=None, roughness_texture_id=None, normal_texture_id=None, transform_param=[1, 1, 0])

Bases: object

Material class used for iG renderer

is_pbr_texture()

Returns whether this material can be used for PBR

is_texture()

Returns whether this material has texture (as opposed to single color)

class igibson.render.mesh_renderer.materials.RandomizedMaterial(material_classes, material_type='texture', kd=[0.5, 0.5, 0.5], texture_id=None, metallic_texture_id=None, roughness_texture_id=None, normal_texture_id=None)

Bases: igibson.render.mesh_renderer.materials.Material

Randomized Material class for material randomization

get_material_files()

Retrieve the material files from the material dataset, given the material classes

Return material_files

a dict that maps material_class to material files

postprocess_material_classes(material_classes)

Postprocess material classes. We currently do not have all the annotated materials, so we will need to convert the materials that we don’t have to their closest neighbors that we do have.

Parameters

material_classes – original material classes

Return material_classes

postprocessed material classes

randomize()

Randomize the material by randomly sampling a material id that belongs to one of the material classes. All potential materials have already been loaded to memory.

igibson.render.mesh_renderer.mesh_renderer_cpu module

igibson.render.mesh_renderer.mesh_renderer_settings module

class igibson.render.mesh_renderer.mesh_renderer_settings.MeshRendererSettings(use_fisheye=False, msaa=False, enable_shadow=False, enable_pbr=True, env_texture_filename='/home/fei/Development/igibson_pip/iGibson/igibson/data/ig_dataset/scenes/background/photo_studio_01_2k.hdr', env_texture_filename2='/home/fei/Development/igibson_pip/iGibson/igibson/data/ig_dataset/scenes/background/photo_studio_01_2k.hdr', env_texture_filename3='/home/fei/Development/igibson_pip/iGibson/igibson/data/ig_dataset/scenes/background/photo_studio_01_2k.hdr', light_modulation_map_filename='', optimized=False, skybox_size=20.0, light_dimming_factor=1.0, fullscreen=False, glfw_gl_version=None, texture_scale=1.0, hide_robot=True)

Bases: object

get_best()
get_fastest()

igibson.render.mesh_renderer.mesh_renderer_tensor module

igibson.render.mesh_renderer.visual_object module

class igibson.render.mesh_renderer.visual_object.VisualObject(filename, VAO_ids, vertex_data_indices, face_indices, id, renderer)

Bases: object

A visual object manages a set of VAOs and textures A wavefront obj file is loaded into openGL and managed by a VisualObject

Module contents