Simulator

Simulator

class gibson2.core.simulator.Simulator(gravity=9.8, timestep=0.004166666666666667, use_fisheye=False, mode='gui', image_width=128, image_height=128, vertical_fov=90, device_idx=0, render_to_tensor=False, auto_sync=True)
__init__(gravity=9.8, timestep=0.004166666666666667, use_fisheye=False, mode='gui', image_width=128, image_height=128, vertical_fov=90, device_idx=0, render_to_tensor=False, auto_sync=True)

Simulator class is a wrapper of physics simulator (pybullet) and MeshRenderer, it loads objects into both pybullet and also MeshRenderer and syncs the pose of objects and robot parts.

Parameters
  • gravity – gravity on z direction.

  • timestep – timestep of physical simulation

  • use_fisheye – use fisheye

  • mode – choose mode from gui, headless, iggui (only open iGibson UI), or pbgui(only open pybullet UI)

  • image_width – width of the camera image

  • image_height – height of the camera image

  • vertical_fov – vertical field of view of the camera image in degrees

  • device_idx – GPU device index to run rendering on

  • render_to_tensor – Render to GPU tensors

  • auto_sync – automatically sync object poses to gibson renderer, by default true,

disable it when you want to run multiple physics step but don’t need to visualize each frame

set_timestep(timestep)
Parameters

timestep – set timestep after the initialization of Simulator

add_viewer()

Attach a debugging viewer to the renderer. This will make the step much slower so should be avoided when training agents

reload()

Destroy the MeshRenderer and physics simulator and start again.

load()

Set up MeshRenderer and physics simulation client. Initialize the list of objects.

import_scene(**kwargs)
import_object(**kwargs)
import_robot(**kwargs)
import_articulated_object(**kwargs)
step()

Step the simulation and update positions in renderer

static update_position(instance)

Update position for an object or a robot in renderer.

Parameters

instance – Instance in the renderer

isconnected()
Returns

pybullet is alive

disconnect()

clean up the simulator