镜像自地址
https://github.com/MINT-SJTU/Evo-RL.git
已同步 2026-11-20 18:17:06 +00:00
fix(ci): resolve quality workflow failures
这个提交包含在:
2
.github/workflows/deploy-website-pages.yml
vendored
2
.github/workflows/deploy-website-pages.yml
vendored
@ -15,7 +15,7 @@ concurrency:
|
||||
jobs:
|
||||
deploy:
|
||||
# Temporarily disabled to keep the website non-public.
|
||||
if: ${{ false }}
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: github-pages
|
||||
|
||||
19
README.md
19
README.md
@ -31,11 +31,11 @@
|
||||
|
||||
## 🧭 Table of Contents
|
||||
|
||||
| Getting Started | Training Pipeline | Project Info |
|
||||
| --- | --- | --- |
|
||||
| [⚡ Quick Start](#quick-start) | [4) Value Function Training](#value-function-training) | [Model & Dataset](#model--dataset) |
|
||||
| [1) Installation](#installation) | [5) Value Inference](#value-inference) | [Community Channels](#community-channels) |
|
||||
| [2) Hardware Setup](#hardware-setup) | [6) Policy Training](#policy-training) | [Affiliations](#affiliations) |
|
||||
| Getting Started | Training Pipeline | Project Info |
|
||||
| -------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------- |
|
||||
| [⚡ Quick Start](#quick-start) | [4) Value Function Training](#value-function-training) | [Model & Dataset](#model--dataset) |
|
||||
| [1) Installation](#installation) | [5) Value Inference](#value-inference) | [Community Channels](#community-channels) |
|
||||
| [2) Hardware Setup](#hardware-setup) | [6) Policy Training](#policy-training) | [Affiliations](#affiliations) |
|
||||
| [3) Data Collection](#data-collection) | [7) Closed-loop Rollout and Next Round](#closed-loop-rollout-and-next-round) | [Citation](#citation) / [License](#license) |
|
||||
|
||||
<p align="center"><strong>Value Visual Results</strong></p>
|
||||
@ -67,11 +67,13 @@
|
||||
</p>
|
||||
|
||||
<a id="quick-start"></a>
|
||||
|
||||
## ⚡ Quick Start
|
||||
|
||||
**LeRobot-aligned foundation:** we use LeRobot as the base of this codebase because its inference and data-collection logic are highly aligned with real-world RL workflows.
|
||||
|
||||
<a id="installation"></a>
|
||||
|
||||
### 1) Installation
|
||||
|
||||
```bash
|
||||
@ -85,6 +87,7 @@ pip install -e .
|
||||
For setup details and platform-specific dependencies, follow the official [LeRobot configuration guide](https://huggingface.co/docs/lerobot/installation).
|
||||
|
||||
<a id="hardware-setup"></a>
|
||||
|
||||
### 2) Hardware Setup
|
||||
|
||||
#### SO Series (SO100/SO101)
|
||||
@ -198,6 +201,7 @@ For dual-arm camera mapping, it is fine to attach `front` under either the left-
|
||||
If needed, you can also use temporary device paths (for example `/dev/ttyACM*` and `/dev/video*`) during initial debugging.
|
||||
|
||||
<a id="agilex-piper-setup"></a>
|
||||
|
||||
#### AgileX PiPER
|
||||
|
||||
For PiPER setup, PiPER uses CAN interfaces instead of serial ports.
|
||||
@ -239,6 +243,7 @@ Optional PiPER flags:
|
||||
```
|
||||
|
||||
<a id="data-collection"></a>
|
||||
|
||||
### 3) Data Collection
|
||||
|
||||
Collect rollout data with `lerobot-human-inloop-record`.
|
||||
@ -314,6 +319,7 @@ lerobot-dataset-report --dataset <HF_USERNAME_OR_ORG>/<DATASET_NAME>
|
||||
This prints: dataset meta, totals, episode-length stats/histogram, success/intervention metrics, task list, and full feature schema.
|
||||
|
||||
<a id="value-function-training"></a>
|
||||
|
||||
### 4) Value Function Training
|
||||
|
||||
Train the value function on the current dataset. Current default: [Pi\*0.6](https://www.pi.website/blog/pistar06) (`--value.type=pistar06`).
|
||||
@ -353,6 +359,7 @@ To plug in a different value function, minimal path in this repo:
|
||||
- Remove/replace the current `pistar06`-only type checks in `src/lerobot/configs/value_train.py` and `src/lerobot/scripts/lerobot_value_infer.py`.
|
||||
|
||||
<a id="value-inference"></a>
|
||||
|
||||
### 5) Value Inference
|
||||
|
||||
Infer value signals and write value/advantage/indicator back to the dataset:
|
||||
@ -408,6 +415,7 @@ complementary_info.acp_indicator_<TAG>
|
||||
These columns are written back to the original dataset specified by `--dataset.repo_id`.
|
||||
|
||||
<a id="policy-training"></a>
|
||||
|
||||
### 6) Policy Training
|
||||
|
||||
Train the policy with advantage-conditioned tags.
|
||||
@ -453,6 +461,7 @@ CUDA_VISIBLE_DEVICES=<GPU_ID_LIST> accelerate launch \
|
||||
```
|
||||
|
||||
<a id="closed-loop-rollout-and-next-round"></a>
|
||||
|
||||
### 7) Closed-loop Rollout and Next Round
|
||||
|
||||
Deploy the trained policy in human-in-loop mode and collect the next dataset round:
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
import logging
|
||||
import time
|
||||
from functools import cached_property
|
||||
from typing import Any
|
||||
|
||||
from lerobot.cameras.utils import make_cameras_from_configs
|
||||
from lerobot.motors import MotorCalibration
|
||||
@ -72,11 +71,11 @@ class PiperFollower(Robot):
|
||||
|
||||
@cached_property
|
||||
def observation_features(self) -> dict[str, type | tuple]:
|
||||
return {**{key: float for key in PIPER_ACTION_KEYS}, **self._cameras_ft}
|
||||
return {**dict.fromkeys(PIPER_ACTION_KEYS, float), **self._cameras_ft}
|
||||
|
||||
@cached_property
|
||||
def action_features(self) -> dict[str, type]:
|
||||
return {key: float for key in PIPER_ACTION_KEYS}
|
||||
return dict.fromkeys(PIPER_ACTION_KEYS, float)
|
||||
|
||||
@property
|
||||
def is_connected(self) -> bool:
|
||||
@ -97,10 +96,15 @@ class PiperFollower(Robot):
|
||||
|
||||
self.configure()
|
||||
should_auto_calibrate = (
|
||||
not self.is_calibrated and calibrate and should_require_piper_calibration(self.config.calibration_mode)
|
||||
not self.is_calibrated
|
||||
and calibrate
|
||||
and should_require_piper_calibration(self.config.calibration_mode)
|
||||
)
|
||||
if should_auto_calibrate:
|
||||
logger.info("No piper-follower calibration file found for '%s'. Running lerobot-calibrate flow.", self.id)
|
||||
logger.info(
|
||||
"No piper-follower calibration file found for '%s'. Running lerobot-calibrate flow.",
|
||||
self.id,
|
||||
)
|
||||
self.calibrate()
|
||||
# Enable behavior should be controlled by enable_on_connect, independent from calibrate flag.
|
||||
# This keeps connect(calibrate=False) commandable for callers that only want to skip interactive calibration.
|
||||
@ -272,7 +276,9 @@ class PiperFollower(Robot):
|
||||
joint_targets = [self._offset_to_target(key, action[key]) for key in joint_keys]
|
||||
joint_commands = [unit_to_milli(value) for value in joint_targets]
|
||||
self.arm.JointCtrl(*joint_commands)
|
||||
sent_action.update({key: milli_to_unit(raw) for key, raw in zip(joint_keys, joint_commands, strict=True)})
|
||||
sent_action.update(
|
||||
{key: milli_to_unit(raw) for key, raw in zip(joint_keys, joint_commands, strict=True)}
|
||||
)
|
||||
elif any(key in action for key in joint_keys):
|
||||
logger.debug("Ignoring partial Piper joint action. Need all six joint keys to send command.")
|
||||
|
||||
|
||||
@ -65,11 +65,11 @@ class PiperLeader(Teleoperator):
|
||||
|
||||
@cached_property
|
||||
def action_features(self) -> dict[str, type]:
|
||||
return {key: float for key in PIPER_ACTION_KEYS}
|
||||
return dict.fromkeys(PIPER_ACTION_KEYS, float)
|
||||
|
||||
@cached_property
|
||||
def feedback_features(self) -> dict[str, type]:
|
||||
return {key: float for key in PIPER_ACTION_KEYS}
|
||||
return dict.fromkeys(PIPER_ACTION_KEYS, float)
|
||||
|
||||
@property
|
||||
def is_connected(self) -> bool:
|
||||
@ -94,8 +94,15 @@ class PiperLeader(Teleoperator):
|
||||
self.arm.MasterSlaveConfig(0xFC, 0x00, 0x00, 0x00)
|
||||
time.sleep(0.05)
|
||||
self.configure()
|
||||
if not self.is_calibrated and calibrate and should_require_piper_calibration(self.config.calibration_mode):
|
||||
logger.info("No piper-leader calibration file found for '%s'. Running lerobot-calibrate flow.", self.id)
|
||||
if (
|
||||
not self.is_calibrated
|
||||
and calibrate
|
||||
and should_require_piper_calibration(self.config.calibration_mode)
|
||||
):
|
||||
logger.info(
|
||||
"No piper-leader calibration file found for '%s'. Running lerobot-calibrate flow.",
|
||||
self.id,
|
||||
)
|
||||
self.calibrate()
|
||||
except Exception:
|
||||
self.arm.DisconnectPort()
|
||||
|
||||
@ -69,7 +69,4 @@ def should_require_piper_calibration(calibration_mode: str) -> bool:
|
||||
return True
|
||||
if calibration_mode == "off":
|
||||
return False
|
||||
raise ValueError(
|
||||
f"Invalid Piper calibration mode '{calibration_mode}'. "
|
||||
"Expected one of: required, off."
|
||||
)
|
||||
raise ValueError(f"Invalid Piper calibration mode '{calibration_mode}'. Expected one of: required, off.")
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
# ruff: noqa: N802
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
|
||||
import lerobot.utils.piper_sdk as piper_sdk_utils
|
||||
import lerobot.robots.piper_follower.piper_follower as piper_follower_module
|
||||
import lerobot.teleoperators.piper_leader.piper_leader as piper_leader_module
|
||||
import lerobot.utils.piper_sdk as piper_sdk_utils
|
||||
from lerobot.motors import MotorCalibration
|
||||
from lerobot.robots.piper_follower import PiperFollower, PiperFollowerConfig
|
||||
from lerobot.robots.utils import make_robot_from_config
|
||||
@ -115,7 +116,9 @@ class FakePiperInterface:
|
||||
|
||||
|
||||
def patch_fake_sdk(monkeypatch):
|
||||
fake_loader = lambda: (FakePiperInterface, FakeLogLevel)
|
||||
def fake_loader():
|
||||
return (FakePiperInterface, FakeLogLevel)
|
||||
|
||||
monkeypatch.setattr(piper_sdk_utils, "get_piper_sdk", fake_loader)
|
||||
monkeypatch.setattr(piper_follower_module, "get_piper_sdk", fake_loader)
|
||||
monkeypatch.setattr(piper_leader_module, "get_piper_sdk", fake_loader)
|
||||
@ -202,17 +205,10 @@ def test_piper_requires_calibration(monkeypatch):
|
||||
teleop.connect(calibrate=False)
|
||||
robot.connect(calibrate=False)
|
||||
try:
|
||||
try:
|
||||
with pytest.raises(RuntimeError, match="require calibration"):
|
||||
teleop.get_action()
|
||||
assert False, "Expected teleop.get_action() to require calibration."
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
with pytest.raises(RuntimeError, match="require calibration"):
|
||||
robot.send_action({"joint_1.pos": 0.0})
|
||||
assert False, "Expected robot.send_action() to require calibration."
|
||||
except RuntimeError:
|
||||
pass
|
||||
finally:
|
||||
teleop.disconnect()
|
||||
robot.disconnect()
|
||||
|
||||
在新工单中引用
屏蔽一个用户