concepts.simulator.pybullet.components.multi_robot_controller.MultiRobotController#

class MultiRobotController[source]#

Bases: BulletComponent

Methods

disable_recoding()

do(robot_index, action_name, **kwargs)

Execute an action on a specific robot.

do_synchronized_ee_pose_trajectories(...)

Execute a synchronized ee pose trajectory action on multiple robots.

do_synchronized_qpos_trajectories_auto_smoothing(...)

Execute a synchronized qpos trajectory auto-smoothing action on multiple robots.

enable_recording()

get_concat_qpos()

make_sync_context()

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

ACTION_NAME_MAPPING

p

w

world

robots

The sequence of robot arms controlled by this MultiRobotController.

current_ctx

The current synchronization context, if any.

recording_enabled

Whether command recording is enabled.

recorded_commands

The list of recorded commands when recording is enabled.

__init__(robots)[source]#
Parameters:

robots (Sequence[BulletArmRobotBase])

__new__(**kwargs)#
disable_recoding()[source]#
do(robot_index, action_name, **kwargs)[source]#

Execute an action on a specific robot.

Parameters:
  • robot_index (int) – index of the robot to perform the action on.

  • action_name (str) – name of the action to perform.

  • **kwargs – additional keyword arguments for the action.

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.

enable_recording()[source]#
get_concat_qpos()[source]#
make_sync_context()[source]#
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.

recording_enabled: bool#

Whether command recording is enabled.

robots: Sequence[BulletArmRobotBase]#

The sequence of robot arms controlled by this MultiRobotController.

property w#
property world#