镜像自地址
https://github.com/MINT-SJTU/Evo-RL.git
已同步 2026-11-20 18:17:06 +00:00
fix(piper): guard LFS pointer URDF and normalize asset file modes
- detect Git LFS pointer URDF early and raise actionable runtime error - add regression test for LFS-pointer URDF guard - normalize PiPER/PiPER-X asset modes from 100755 to 100644
这个提交包含在:
0
src/lerobot/assets/piper_description/meshes/base_link.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/base_link.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link1.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link1.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link2.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link2.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link3.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link3.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link4.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link4.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link5.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link5.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link6.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_description/meshes/link6.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/Link6.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/Link6.STL
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J1.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J1.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J2.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J2.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J3.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J3.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J4.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J4.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J5.dae
可执行文件 -> 普通文件
0
src/lerobot/assets/piper_x_description/meshes/dae/J5.dae
可执行文件 -> 普通文件
@ -45,6 +45,21 @@ PIPER_CALIB_KEYS = list(PIPER_ACTION_KEYS)
|
||||
PIPER_CALIB_IDS = {key: idx for idx, key in enumerate(PIPER_CALIB_KEYS)}
|
||||
DEFAULT_PIPER_GRAVITY_URDF = "assets/piper_description/urdf/piper_no_gripper_description.urdf"
|
||||
DEFAULT_PIPERX_GRAVITY_URDF = "assets/piper_x_description/urdf/piper_x_description_no_gripper.urdf"
|
||||
GIT_LFS_POINTER_PREFIX = b"version https://git-lfs.github.com/spec/v1"
|
||||
|
||||
|
||||
def _ensure_not_lfs_pointer(path_obj: Any, relpath: str) -> None:
|
||||
with path_obj.open("rb") as f:
|
||||
head = f.read(128)
|
||||
if head.startswith(GIT_LFS_POINTER_PREFIX):
|
||||
raise RuntimeError(
|
||||
"Bundled PiPER assets are still Git LFS pointer files. "
|
||||
"Please run `git lfs pull --include="
|
||||
"\"src/lerobot/assets/piper_description/**,src/lerobot/assets/piper_x_description/**\" "
|
||||
"--exclude=\"*\"` and `git lfs checkout src/lerobot/assets/piper_description "
|
||||
"src/lerobot/assets/piper_x_description`, then retry. "
|
||||
f"(file: {relpath})"
|
||||
)
|
||||
|
||||
|
||||
class PiperLeader(Teleoperator):
|
||||
@ -220,6 +235,7 @@ class PiperLeader(Teleoperator):
|
||||
"Bundled gravity compensation URDF is missing: "
|
||||
f"{self.gravity_comp_urdf_relpath}. Reinstall the package."
|
||||
)
|
||||
_ensure_not_lfs_pointer(default_urdf, self.gravity_comp_urdf_relpath)
|
||||
urdf_path = str(default_urdf)
|
||||
if self._gravity_comp_loop is None:
|
||||
self._gravity_comp_loop = PiperGravityCompensationLoop(
|
||||
|
||||
@ -502,3 +502,15 @@ def test_piper_connect_fails_and_writes_follower_role_when_in_teach_mode(monkeyp
|
||||
device.connect(calibrate=False)
|
||||
|
||||
assert device.arm.role_commands[-1] == (0xFC, 0x00, 0x00, 0x00)
|
||||
|
||||
|
||||
def test_piper_lfs_pointer_urdf_raises_actionable_error(tmp_path):
|
||||
pointer_file = tmp_path / "lfs_pointer.urdf"
|
||||
pointer_file.write_text(
|
||||
"version https://git-lfs.github.com/spec/v1\n"
|
||||
"oid sha256:deadbeef\n"
|
||||
"size 123\n"
|
||||
)
|
||||
|
||||
with pytest.raises(RuntimeError, match="Git LFS pointer files"):
|
||||
piper_leader_module._ensure_not_lfs_pointer(pointer_file, "assets/piper_description/urdf/pointer.urdf")
|
||||
|
||||
在新工单中引用
屏蔽一个用户