mirror of
https://github.com/huggingface/lerobot.git
synced 2026-06-18 08:47:05 +00:00
fix(robots): restore joint clipping and wrist_yaw fallback in ReBot B601 send_action
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user