forked from tangger/lerobot
Add setup_motors
This commit is contained in:
@@ -141,6 +141,12 @@ class HopeJrArm(Robot):
|
|||||||
self.bus.configure_motors()
|
self.bus.configure_motors()
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
def setup_motors(self) -> None:
|
||||||
|
for motor in reversed(self.bus.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]:
|
def get_observation(self) -> dict[str, Any]:
|
||||||
if not self.is_connected:
|
if not self.is_connected:
|
||||||
raise DeviceNotConnectedError(f"{self} is not connected.")
|
raise DeviceNotConnectedError(f"{self} is not connected.")
|
||||||
|
|||||||
@@ -151,6 +151,12 @@ class HopeJrHand(Robot):
|
|||||||
self.bus.configure_motors()
|
self.bus.configure_motors()
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
def setup_motors(self) -> None:
|
||||||
|
for motor in self.bus.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]:
|
def get_observation(self) -> dict[str, Any]:
|
||||||
if not self.is_connected:
|
if not self.is_connected:
|
||||||
raise DeviceNotConnectedError(f"{self} is not connected.")
|
raise DeviceNotConnectedError(f"{self} is not connected.")
|
||||||
|
|||||||
Reference in New Issue
Block a user