robosuite.renderers.mujoco package

Submodules

robosuite.renderers.mujoco.mujoco_py_renderer module

class robosuite.renderers.mujoco.mujoco_py_renderer.CustomMjViewer(sim)

Bases: mujoco_py.mjviewer.MjViewer

Custom class extending the vanilla MjViewer class to add additional key-stroke callbacks

key_callback(window, key, scancode, action, mods)

Processes key callbacks from the glfw renderer

Parameters
  • window (GLFWwindow) – GLFW window instance

  • key (int) – keycode

  • scancode (int) – scancode

  • action (int) – action code

  • mods (int) – mods

keypress = {}
keyrepeat = {}
keyup = {}
class robosuite.renderers.mujoco.mujoco_py_renderer.MujocoPyRenderer(sim)

Bases: object

Mujoco-py renderer object

Parameters

sim – MjSim object

add_keypress_callback(key, fn)

Allows for custom callback functions for the viewer. Called on key down. Parameter ‘any’ will ensure that the callback is called on any key down, and block default mujoco viewer callbacks from executing, except for the ESC callback to close the viewer.

Parameters
  • key (int) – keycode

  • fn (function handle) – function callback to associate with the keypress

add_keyrepeat_callback(key, fn)

Allows for custom callback functions for the viewer. Called on key repeat. Parameter ‘any’ will ensure that the callback is called on any key repeat, and block default mujoco viewer callbacks from executing, except for the ESC callback to close the viewer.

Parameters
  • key (int) – keycode

  • fn (function handle) – function callback to associate with the keypress

add_keyup_callback(key, fn)

Allows for custom callback functions for the viewer. Called on key up. Parameter ‘any’ will ensure that the callback is called on any key up, and block default mujoco viewer callbacks from executing, except for the ESC callback to close the viewer.

Parameters
  • key (int) – keycode

  • fn (function handle) – function callback to associate with the keypress

close()

Destroys the open window and renders (pun intended) the viewer useless.

render()

Renders the screen

set_camera(camera_id)

Set the camera view to the specified camera ID.

Parameters

camera_id (int) – id of the camera to set the current viewer to

Module contents