embodichain.lab#
Submodules
Device Management#
Classes:
Base class for all robot controllers. |
|
Controller that bridges input devices (VR, keyboard, etc.) with robot control. |
- class embodichain.lab.devices.Device[source]#
Bases:
objectBase class for all robot controllers. Defines basic interface for all controllers to adhere to.
Methods:
Returns the current state of the device, a dictionary of pos, orn, grasp, and reset.
Method that should be called externally before controller can start receiving commands.
Method that should be called externally to stop the controller.
- abstract get_controller_state()[source]#
Returns the current state of the device, a dictionary of pos, orn, grasp, and reset.
- class embodichain.lab.devices.DeviceController[source]#
Bases:
objectController that bridges input devices (VR, keyboard, etc.) with robot control.
This controller is agnostic to the environment and can be used in both gym environments and pure simulation contexts. It handles: - Mapping device input to robot joint commands - Joint limit enforcement - Filtering and smoothing (if not handled by device) - Multi-device support
Example
# In gym environment controller = DeviceController(robot=env.robot, device=vr_device) action = controller.get_action() env.step(action)
# In pure simulation controller = DeviceController(robot=sim_robot, device=vr_device) qpos = controller.get_action() sim_robot.set_qpos(qpos)
Methods:
__init__(robot[, device, device_name])Initialize Device Controller.
add_device(device, device_name[, set_active])Add a new input device.
get_action([device_name, as_dict])Get robot action from device input.
Get list of all registered device names.
get_device_info([device_name])Get information about a device.
remove_device(device_name)Remove a device.
reset()Reset controller state.
set_active_device(device_name)Set the active input device.
Attributes:
Get the currently active device.
- add_device(device, device_name, set_active=False)[source]#
Add a new input device.
- Parameters:
device (
Device) – Device instance to add.device_name (
str) – Name identifier for the device.set_active (
bool) – Whether to set this as the active device.
- Return type:
None
- get_action(device_name=None, as_dict=False)[source]#
Get robot action from device input.
- Parameters:
device_name (
Optional[str]) – Name of device to query. If None, uses active device.as_dict (
bool) – Whether to return action as dict (joint_name -> value).
- Returns:
[num_envs, num_joints]) or dict, or None if no valid data available.
- Return type:
Robot action tensor (shape
- get_device_info(device_name=None)[source]#
Get information about a device.
- Parameters:
device_name (
Optional[str]) – Name of device. If None, uses active device.- Return type:
Dict[str,Any]- Returns:
Device information dict.