robosuite.devices package#

Submodules#

robosuite.devices.device module#

class robosuite.devices.device.Device(env)#

Bases: object

Base class for all robot controllers. Defines basic interface for all controllers to adhere to. Also contains shared logic for managing multiple and/or multiarmed robots.

property active_arm#
property active_arm_index#
property base_mode#
get_arm_action(robot, arm, norm_delta, goal_update_mode='target')#
abstract get_controller_state() Dict#

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

property grasp#
input2action(mirror_actions=False) Dict | None#

Converts an input from an active device into a valid action sequence that can be fed into an env.step() call

If a reset is triggered from the device, immediately returns None. Else, returns the appropriate action

Parameters:

mirror_actions (bool) – actions corresponding to viewing robot from behind. first axis: left/right. second axis: back/forward. third axis: down/up.

Returns:

Dictionary of actions to be fed into env.step()

if reset is triggered, returns None

Return type:

Optional[Dict]

abstract start_control()#

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

robosuite.devices.keyboard module#

robosuite.devices.mjgui module#

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

Bases: Device

Class for ‘device’ involving mujoco viewer and mocap bodies being dragged by user’s mouse.

Parameters:

env (RobotEnv) – The environment which contains the robot(s) to control using this device.

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.

start_control()#

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

robosuite.devices.mjgui.get_mocap_pose(sim, mocap_name: str = 'target') Tuple[ndarray, ndarray]#
robosuite.devices.mjgui.set_mocap_pose(sim, target_pos: ndarray | None = None, target_mat: ndarray | None = None, mocap_name: str = 'target')#

robosuite.devices.spacemouse module#

Module contents#