From 5a2c0369a2581bc8a2863c060b9f48e1a28bd24e Mon Sep 17 00:00:00 2001 From: Khalil Meftah Date: Thu, 11 Jun 2026 19:58:55 +0200 Subject: [PATCH] fix(robots): restore joint clipping and wrist_yaw fallback in ReBot B601 send_action --- .../rebot_b601_follower/rebot_b601_follower.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py b/src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py index 20f762ae5..fb1409f36 100644 --- a/src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py +++ b/src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py @@ -244,6 +244,22 @@ class RebotB601Follower(Robot): """ goal_pos = {key.removesuffix(".pos"): val for key, val in action.items() if key.endswith(".pos")} + # Clip against soft joint limits. + for motor_name in list(goal_pos): + if motor_name in self.config.joint_limits: + min_limit, max_limit = self.config.joint_limits[motor_name] + clipped = max(min_limit, min(max_limit, goal_pos[motor_name])) + if clipped != goal_pos[motor_name]: + logger.debug(f"Clipped {motor_name} from {goal_pos[motor_name]:.2f} to {clipped:.2f}") + goal_pos[motor_name] = clipped + + # Tolerate 6-DOF leaders that have no wrist_yaw joint by holding it at zero. + # This is intentional: it lets a 6-DOF leader such as the SO-100 / SO-101 + # (so100_leader / so101_leader) teleoperate this 7-DOF follower — the missing + # wrist_yaw command is simply treated as 0.0 instead of raising. + if "wrist_yaw" not in goal_pos: + goal_pos["wrist_yaw"] = 0.0 + # Cap relative target when too far from the present position. if self.config.max_relative_target is not None: present_pos = self._present_pos()