From 5c2566a4a904cde48443e48df5194fc48d310de1 Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Fri, 4 Apr 2025 18:15:12 +0200 Subject: [PATCH] fix(robots): fix send_action in lekiwi client part 2 --- lerobot/common/robots/lekiwi/lekiwi_client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lerobot/common/robots/lekiwi/lekiwi_client.py b/lerobot/common/robots/lekiwi/lekiwi_client.py index cfcd2d3e..bb2fefe7 100644 --- a/lerobot/common/robots/lekiwi/lekiwi_client.py +++ b/lerobot/common/robots/lekiwi/lekiwi_client.py @@ -287,6 +287,7 @@ class LeKiwiClient(Robot): # TODO(Steven): This is flaky, for example, if we received a state but failed decoding the image, we will not update any value # TODO(Steven): All this function needs to be refactored + # TODO(Steven): Fix this next def _get_data(self): # Copied from robot_lekiwi.py """Polls the video socket for up to 15 ms. If data arrives, decode only @@ -470,7 +471,9 @@ class LeKiwiClient(Robot): motors_name = self.state_feature.get("names").get("motors") - common_keys = [key for key in action if any(key in motor for motor in motors_name)] + common_keys = [ + key for key in action if key in (motor.replace("arm_", "") for motor in motors_name) + ] if len(common_keys) < 6: logging.error("Action should include at least the states of the leader arm")