Skip to content

Multi-robot control

Robot command indices come from scene discovery. Never assume a particular arm is index 0 or that two robots have the same number or order of joints.

Control two robots independently

from sim2bot import Robot


def main() -> None:
    with Robot(auto_bridge=True, wait_for_sim=True) as sim:
        robots = sim.describe()
        if len(robots) < 2:
            raise RuntimeError("Load at least two robots in the Sim2Bot scene")

        left, right = robots[:2]
        sim.move_to(left.home, robot=left.index)
        sim.move_to(right.home, robot=right.index)

        left_ready = sim.wait_until_reached(left.home, robot=left.index)
        right_ready = sim.wait_until_reached(right.home, robot=right.index)
        print({left.name: left_ready, right.name: right_ready})


if __name__ == "__main__":
    main()

Use RobotInfo.id when you need to recognize the same scene instance in labels or saved application state. Use RobotInfo.index for current SDK commands.

Current base limitation

Arm commands and telemetry are robot-addressed. Multi-base addressing is still being completed; read the preview warning on base_velocity() before using several mobile or aerial robots.

Relevant APIs