Skip to content

Commit 7fada7f

Browse files
authored
Merge pull request #27 from KraHsu/feat/m4-asset-zoo-franka-menagerie
Upgrade FrankaPandaCfg to Menagerie franka_emika_panda
2 parents 8da0d63 + 2b39697 commit 7fada7f

5 files changed

Lines changed: 46 additions & 31 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ trajectory so breaking changes can land in any minor release until the 1.0 stabi
1212
`UnitreeG1Cfg` (29-DoF humanoid, 6 DCMotor groups mirroring
1313
`examples/unitree/.../g1/constants.py`), `UnitreeGo1Cfg` (12-DoF quadruped, 3
1414
ImplicitPD groups aligned to Isaac Lab Go1 defaults), and `AnymalCCfg` (12-DoF
15-
quadruped, single ImplicitPD group aligned to Isaac Lab Anymal C defaults). The three
16-
Menagerie-sourced robots ship as `.tar.gz` bundles in `KraHsu/genelab-assets`,
17-
preserving BSD-3-Clause attribution.
15+
quadruped, single ImplicitPD group aligned to Isaac Lab Anymal C defaults). All four
16+
Menagerie-sourced robots (Franka, G1, Go1, Anymal C) ship as `.tar.gz` bundles in
17+
`KraHsu/genelab-assets`, preserving the upstream LICENSE and README.
1818
- `AssetSpec.archive_member`: optional field that switches `fetch_asset` from
1919
single-file to archive mode. The URL is treated as a `.tar.gz`, the blob's md5 is
2020
verified end-to-end, and `tarfile`'s `data` filter extracts the contents into
@@ -28,6 +28,14 @@ trajectory so breaking changes can land in any minor release until the 1.0 stabi
2828
`examples/inverted_pendulum` (`stiffness=80`, passive pole); Franka follows Isaac
2929
Lab's high-PD configuration (`panda_arm` k=400, `panda_hand` k=1e4) with the
3030
Menagerie home pose.
31+
32+
### Changed
33+
34+
- **Breaking** (asset zoo only — no released API): `FrankaPandaCfg` now sources the full
35+
MuJoCo Menagerie `franka_emika_panda` model (Apache-2.0) instead of the minimal stub
36+
shipped during initial M4. Joint regexes drop the `panda_` prefix (`joint[1-7]`,
37+
`finger_joint.*`) to match the upstream MJCF, and `default_joint_pos` follows the
38+
Menagerie `home` keyframe (`joint4=-1.57079`, `joint6=1.57079`, `joint7=-0.7853`).
3139
- `genelab.utils.download.fetch_asset` + `AssetSpec` + `AssetDownloadError`: md5-verified
3240
download helper for asset zoo entries. Files cache under
3341
`<project_root>/.cache/assets/<name>/<md5>/<filename>` via atomic stage-and-rename;

‎docs/concepts/asset_zoo.en.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,20 @@ every subsequent call resolves to the cached path.
4242

4343
Use `genelab info <name>` to print the full override-path tree once registered.
4444
Cartpole mirrors `examples/inverted_pendulum`'s gains; G1 mirrors
45-
`examples/unitree/.../g1/constants.py`; Go1 and Anymal C follow Isaac Lab's published
46-
defaults so cross-stack experiments stay comparable.
45+
`examples/unitree/.../g1/constants.py`; Franka, Go1, and Anymal C follow Isaac Lab's
46+
published defaults so cross-stack experiments stay comparable. The four Menagerie-sourced
47+
entries (`franka`, `g1`, `go1`, `anymal-c`) ship as `.tar.gz` archives so meshes and
48+
textures travel with the MJCF.
4749

4850
## Cache layout and md5 verification
4951

50-
Single-file mode (cartpole, franka):
52+
Single-file mode (cartpole):
5153

5254
```
5355
.cache/assets/<name>/<md5>/<filename>
5456
```
5557

56-
Archive mode (g1, go1, anymal-c):
58+
Archive mode (franka, g1, go1, anymal-c):
5759

5860
```
5961
.cache/assets/<name>/<md5>/extracted/<archive_member>

‎docs/concepts/asset_zoo.zh.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ Isaac Lab 自带 40+ 现成机器人配置,MjLab 自带 3 个;两者都把
2424
| `go1` | `UnitreeGo1Cfg()` | 12 | `hip` / `thigh` / `calf`(ImplicitPD,k=25) |
2525
| `anymal-c` | `AnymalCCfg()` | 12 | `legs`(单 ImplicitPD 组,k=80) |
2626

27-
注册完成后用 `genelab info <name>` 打印完整的 override 路径树。Cartpole 的增益与 `examples/inverted_pendulum` 保持一致;G1 与 `examples/unitree/.../g1/constants.py` 对齐;Go1 与 Anymal C 沿用 Isaac Lab 公开的默认值,方便跨栈对比实验。
27+
注册完成后用 `genelab info <name>` 打印完整的 override 路径树。Cartpole 的增益与 `examples/inverted_pendulum` 保持一致;G1 与 `examples/unitree/.../g1/constants.py` 对齐;Franka、Go1 与 Anymal C 沿用 Isaac Lab 公开的默认值,方便跨栈对比实验。4 个 Menagerie 来源条目(`franka`、`g1`、`go1`、`anymal-c`)以 `.tar.gz` archive 形式发布,mesh 与纹理随 MJCF 一并发送。
2828

2929
## 缓存目录与 md5 校验
3030

31-
单文件模式(cartpole、franka):
31+
单文件模式(cartpole):
3232

3333
```
3434
.cache/assets/<name>/<md5>/<filename>
3535
```
3636

37-
archive 模式(g1、go1、anymal-c):
37+
archive 模式(franka、g1、go1、anymal-c):
3838

3939
```
4040
.cache/assets/<name>/<md5>/extracted/<archive_member>

‎src/genelab/asset_zoo/franka.py‎

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""Franka Emika Panda asset zoo entry — 7-DoF arm + 2-finger parallel gripper.
22
3-
Joints split into two actuator groups: a high-PD arm group covering ``panda_joint1..7``
4-
and a stiffer finger group covering the parallel-jaw fingers. Gain values follow
5-
Isaac Lab's ``FRANKA_PANDA_HIGH_PD_CFG`` so behaviour transfers when downstream code
6-
mixes the two stacks. ``default_joint_pos`` matches the MuJoCo Menagerie home keyframe.
3+
Sourced from MuJoCo Menagerie ``franka_emika_panda`` (Apache-2.0). Joint names follow
4+
the upstream convention (``joint1..7`` plus ``finger_joint1..2``) and the default pose
5+
matches the Menagerie ``home`` keyframe. Two actuator groups split arm and hand with
6+
the Isaac Lab ``FRANKA_PANDA_HIGH_PD_CFG`` gains so cross-stack behaviour stays
7+
comparable.
78
"""
89

910
from typing import Final
@@ -15,20 +16,22 @@
1516

1617
_MJCF: Final = AssetSpec(
1718
name="franka",
18-
url="https://raw.githubusercontent.com/KraHsu/genelab-assets/main/franka/franka.xml",
19-
md5="4c413c93f77e8e7bd5364c23a772c72d",
20-
filename="franka.xml",
19+
url="https://raw.githubusercontent.com/KraHsu/genelab-assets/main/franka_emika_panda/franka_emika_panda.tar.gz",
20+
md5="6890871be5fbb852a13b6be2a766f270",
21+
filename="franka_emika_panda.tar.gz",
22+
archive_member="franka_emika_panda/panda.xml",
2123
)
2224

25+
# Menagerie home keyframe: qpos = "0 0 0 -1.57079 0 1.57079 -0.7853 0.04 0.04".
2326
_HOME_POSE: Final[dict[str, float]] = {
24-
"panda_joint1": 0.0,
25-
"panda_joint2": -0.785,
26-
"panda_joint3": 0.0,
27-
"panda_joint4": -2.356,
28-
"panda_joint5": 0.0,
29-
"panda_joint6": 1.571,
30-
"panda_joint7": 0.785,
31-
"panda_finger_joint.*": 0.04,
27+
"joint1": 0.0,
28+
"joint2": 0.0,
29+
"joint3": 0.0,
30+
"joint4": -1.57079,
31+
"joint5": 0.0,
32+
"joint6": 1.57079,
33+
"joint7": -0.7853,
34+
"finger_joint.*": 0.04,
3235
}
3336

3437

@@ -47,15 +50,15 @@ def FrankaPandaCfg() -> ArticulationCfg:
4750
default_joint_pos=dict(_HOME_POSE),
4851
actuators={
4952
"panda_arm": ImplicitPDActuatorCfg(
50-
target_names_expr=(r"panda_joint[1-7]",),
53+
target_names_expr=(r"joint[1-7]",),
5154
stiffness=400.0,
5255
damping=80.0,
5356
effort_limit=87.0,
5457
velocity_limit=2.175,
5558
action_scale=0.5,
5659
),
5760
"panda_hand": ImplicitPDActuatorCfg(
58-
target_names_expr=(r"panda_finger_joint.*",),
61+
target_names_expr=(r"finger_joint.*",),
5962
stiffness=1.0e4,
6063
damping=200.0,
6164
effort_limit=20.0,
@@ -69,7 +72,7 @@ def FrankaPandaCfg() -> ArticulationCfg:
6972
register_robot(
7073
"franka",
7174
FrankaPandaCfg,
72-
description="Franka Emika Panda 7-DoF arm with parallel-jaw gripper; high-PD gains.",
75+
description="Franka Emika Panda 7-DoF arm + parallel gripper (Menagerie source); high-PD gains.",
7376
cfg_type=ArticulationCfg,
7477
examples=[
7578
"genelab info franka",

‎tests/test_asset_zoo.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ def test_franka_actuator_groups(monkeypatch: pytest.MonkeyPatch) -> None:
5959
cfg = FrankaPandaCfg()
6060
arm = cfg.actuators["panda_arm"]
6161
hand = cfg.actuators["panda_hand"]
62-
assert arm.target_names_expr == (r"panda_joint[1-7]",)
62+
# Menagerie panda.xml uses unprefixed joint names.
63+
assert arm.target_names_expr == (r"joint[1-7]",)
6364
assert arm.stiffness == 400.0
6465
assert arm.damping == 80.0
65-
assert hand.target_names_expr == (r"panda_finger_joint.*",)
66+
assert hand.target_names_expr == (r"finger_joint.*",)
6667
assert hand.stiffness == 1.0e4
6768
assert hand.damping == 200.0
68-
assert cfg.default_joint_pos["panda_joint4"] == pytest.approx(-2.356)
69+
# Home keyframe qpos[3] (joint4) = -1.57079.
70+
assert cfg.default_joint_pos["joint4"] == pytest.approx(-1.57079)
6971

7072

7173
def test_registry_examples() -> None:

0 commit comments

Comments
 (0)