This commit is contained in:
Martino Russi
2026-07-10 18:22:28 +02:00
parent 09a19ef6b5
commit 6f5641827e
5 changed files with 30 additions and 10 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
# docs-requirements.txt
hf-doc-builder @ git+https://github.com/huggingface/doc-builder.git@main
watchdog>=6.0.0
watchdog>=6.0.0
+3 -1
View File
@@ -297,7 +297,9 @@ class OpenCVCamera(Camera):
f"{self} failed to set capture_height={self.capture_height} ({actual_height=}, {height_success=})."
)
if not height_success:
logger.warning(f"{self} set(CAP_PROP_FRAME_HEIGHT) returned False but {actual_height=} is correct.")
logger.warning(
f"{self} set(CAP_PROP_FRAME_HEIGHT) returned False but {actual_height=} is correct."
)
@staticmethod
def find_cameras() -> list[dict[str, Any]]:
+20 -6
View File
@@ -379,14 +379,28 @@ def main() -> None:
if args.grippers:
try:
grippers["L"] = build_gripper(
"L", args.gripper_port_left, args.gripper_send_id, args.gripper_recv_id,
args.gripper_motor_type, args.gripper_fd, args.gripper_open_deg,
args.gripper_close_deg, args.gripper_kp, args.gripper_kd,
"L",
args.gripper_port_left,
args.gripper_send_id,
args.gripper_recv_id,
args.gripper_motor_type,
args.gripper_fd,
args.gripper_open_deg,
args.gripper_close_deg,
args.gripper_kp,
args.gripper_kd,
)
grippers["R"] = build_gripper(
"R", args.gripper_port_right, args.gripper_send_id, args.gripper_recv_id,
args.gripper_motor_type, args.gripper_fd, args.gripper_open_deg,
args.gripper_close_deg, args.gripper_kp, args.gripper_kd,
"R",
args.gripper_port_right,
args.gripper_send_id,
args.gripper_recv_id,
args.gripper_motor_type,
args.gripper_fd,
args.gripper_open_deg,
args.gripper_close_deg,
args.gripper_kp,
args.gripper_kd,
)
except Exception as e: # noqa: BLE001
print(f"WARNING: gripper setup failed ({e}); continuing without grippers.")
@@ -147,7 +147,9 @@ class ExoskeletonArm:
smoothed: dict[str, float] = {}
for joint, value in angles.items():
prev = self._ema.get(joint)
self._ema[joint] = value if prev is None else self._ema_alpha * value + (1 - self._ema_alpha) * prev
self._ema[joint] = (
value if prev is None else self._ema_alpha * value + (1 - self._ema_alpha) * prev
)
smoothed[joint] = self._ema[joint]
return smoothed
@@ -295,7 +295,9 @@ class UnitreeG1Teleoperator(Teleoperator):
gripper_buttons = self._exo_gripper_buttons(left_raw, right_raw)
return {**joint_action, **rc.remote_action, **gripper_buttons}
def _exo_gripper_buttons(self, left_raw: list[int] | None, right_raw: list[int] | None) -> dict[str, float]:
def _exo_gripper_buttons(
self, left_raw: list[int] | None, right_raw: list[int] | None
) -> dict[str, float]:
"""Exo joystick clicks as button flags: L3 (left stick) -> button.4, R3 (right) -> button.0.
Reads the raw joystick-button ADC channel directly (pressed pulls it below mid-scale),