From 51efe6dfee35caf9050c6b4f1a47273ad48a7cf8 Mon Sep 17 00:00:00 2001 From: Simon Alibert Date: Thu, 15 May 2025 11:46:41 +0200 Subject: [PATCH] Add setup_motors for lekiwi --- lerobot/common/robots/lekiwi/lekiwi.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lerobot/common/robots/lekiwi/lekiwi.py b/lerobot/common/robots/lekiwi/lekiwi.py index 02474898a..986b9d1ea 100644 --- a/lerobot/common/robots/lekiwi/lekiwi.py +++ b/lerobot/common/robots/lekiwi/lekiwi.py @@ -16,6 +16,7 @@ import logging import time +from itertools import chain from typing import Any from lerobot.common.cameras.utils import make_cameras_from_configs @@ -183,6 +184,12 @@ class LeKiwi(Robot): self.bus.enable_torque() + def setup_motors(self) -> None: + for motor in chain(reversed(self.arm_motors), reversed(self.base_motors)): + input(f"Connect the controller board to the '{motor}' motor only and press enter.") + self.bus.setup_motor(motor) + print(f"'{motor}' motor id set to {self.bus.motors[motor].id}") + def get_observation(self) -> dict[str, Any]: if not self.is_connected: raise DeviceNotConnectedError(f"{self} is not connected.")