Device#

Devices allow for direct real-time interfacing with the MuJoCo simulation. The currently supported devices are Keyboard. SpaceMouse. DualSense and MjGUI.

Base Device#

class robosuite.devices.device.Device(*args: Any, **kwargs: Any)#
abstract start_control()#

Method that should be called externally before controller can start receiving commands.

abstract get_controller_state() Dict#

Returns the current state of the device, a dictionary of pos, orn, grasp, and reset.

Keyboard Device#

class robosuite.devices.keyboard.Keyboard(*args: Any, **kwargs: Any)#
get_controller_state()#
on_press()#
on_release()#
_display_controls()#

SpaceMouse Device#

class robosuite.devices.spacemouse.SpaceMouse(*args: Any, **kwargs: Any)#
get_controller_state()#
run()#
control()#
control_gripper()#
_display_controls()#

DualSense Device#

class robosuite.devices.dualsense.DualSense(*args: Any, **kwargs: Any)#
get_controller_state()#

Grabs the current state of the 3D mouse.

Returns:

A dictionary containing dpos, orn, unmodified orn, grasp, and reset

Return type:

dict

run()#

Listener method that keeps pulling new messages.

control()#

Grabs current pose of DualSense

Returns:

6-DoF control value

Return type:

np.array

control_gripper()#

Maps internal states into gripper commands.

Returns:

Whether we’re using single click and hold or not

Return type:

float

static _display_controls()#

Method to pretty print controls.

_check_connection_type()#

Get the connection type of the DualSense controller. ConnectionType: - USB: DualSense connected via USB - BT01: DualSense connected via Bluetooth, sends input report id 0x01 - BT31: DualSense connected via Bluetooth, sends input report id 0x31 - UNKNOWN: Unknown connection type

Returns:

connection type(USB, BT01, BT31, UNKNOWN)

Return type:

ConnectionType

MjGUI Device#

class robosuite.devices.mjgui.MJGUI(*args: Any, **kwargs: Any)#
get_controller_state()#

Grabs the current state of the keyboard. :returns: A dictionary containing dpos, orn, unmodified orn, grasp, and reset :rtype: dict

input2action() Dict[str, ndarray]#

Uses mocap body poses to determine action for robot. Obtain input_type (i.e. absolute actions or delta actions) and input_ref_frame (i.e. world frame, base frame or eef frame) from the controller itself.

static _display_controls()#

Method to pretty print controls.