concepts.simulator.pybullet.components.multi_robot_controller.MultiRobotController#
- class MultiRobotController[source]#
Bases:
BulletComponent
Methods
do
(robot_index, action_name, **kwargs)Execute an action on a specific robot.
Execute a synchronized ee pose trajectory action on multiple robots.
Execute a synchronized qpos trajectory auto-smoothing action on multiple robots.
replay
(commands)Replay a sequence of recorded commands.
stable_reset
([nr_steps])Reset the robots to a stable state by holding their current positions.
Attributes
The sequence of robot arms controlled by this MultiRobotController.
The current synchronization context, if any.
Whether command recording is enabled.
The list of recorded commands when recording is enabled.
- __init__(robots)[source]#
- Parameters:
robots (Sequence[BulletArmRobotBase])
- __new__(**kwargs)#
- do(robot_index, action_name, **kwargs)[source]#
Execute an action on a specific robot.
- Parameters:
- Returns:
a control command object representing the action.
- Raises:
AssertionError – If the robot index is out of range.
- Return type:
_ControlCommand
- do_synchronized_ee_pose_trajectories(trajectories)[source]#
Execute a synchronized ee pose trajectory action on multiple robots.
- Parameters:
trajectories (Sequence[Sequence[Tuple[ndarray, ndarray]]]) – a sequence of ee pose trajectories for each robot.
- Raises:
AssertionError – If the number of trajectories does not match the number of robots.
AssertionError – If the length of the trajectories does not match.
- do_synchronized_qpos_trajectories_auto_smoothing(trajectories, step_size=1, gains=0.3, atol=0.03, timeout=20, verbose=False)[source]#
Execute a synchronized qpos trajectory auto-smoothing action on multiple robots.
- Parameters:
trajectories (Sequence[Sequence[ndarray]]) – a sequence of qpos trajectories for each robot.
step_size (float) – the step size for the auto-smoothing.
gains (float) – the gains for the auto-smoothing.
atol (float) – the absolute tolerance for the auto-smoothing.
timeout (float) – the timeout for the auto-smoothing.
verbose (bool) – whether to print verbose output.
- Raises:
AssertionError – If the number of trajectories does not match the number of robots.
AssertionError – If the length of the trajectories does not match.
- replay(commands)[source]#
Replay a sequence of recorded commands.
- Parameters:
commands – a sequence of recorded commands to replay.
- Raises:
AssertionError – If the recording is enabled.
- stable_reset(nr_steps=10)[source]#
Reset the robots to a stable state by holding their current positions.
- Parameters:
nr_steps – the number of steps to hold the positions.
- ACTION_NAME_MAPPING = {'close_gripper_free': 'close_gripper_free_set_control', 'grasp': 'grasp_set_control', 'move_cartesian_trajectory': 'move_cartesian_trajectory_set_control', 'move_qpos': 'move_qpos_set_control', 'move_qpos_path_v2': 'move_qpos_path_v2_set_control', 'open_gripper_free': 'open_gripper_free_set_control'}#
- current_ctx: MultiRobotControllerContext | None#
The current synchronization context, if any.
- property p#
- recorded_commands: List[RecordedControlCommand]#
The list of recorded commands when recording is enabled.
- robots: Sequence[BulletArmRobotBase]#
The sequence of robot arms controlled by this MultiRobotController.
- property w#
- property world#