Commit 5c78379
authored
Fix Unitree Go1 and Go2 calf actuator limits ignoring the knee reduction (#7564)
# Description
Fixes #7479.
`UNITREE_GO1_CFG` and `UNITREE_GO2_CFG` apply one set of DC-motor limits
to all twelve leg joints, but on both robots the calf sits behind an
extra knee reduction. The calf was capped at roughly half its rated
torque, while the torque-speed curve kept producing motoring torque up
to a no-load speed the hardware cannot reach.
The values are not a guess — they are already authored in the USD assets
we ship, and the Python configs were discarding them. Dumping the joint
drives from the configured asset root:
| joint | `go2.usd` `maxForce` | `go2.usd` `maxJointVelocity` | old
config |
| --- | --- | --- | --- |
| hip / thigh | 23.7 N·m | 1724.6 °/s = 30.1 rad/s | 23.5 / 30.0 |
| calf | **45.43 N·m** | 899.54 °/s = **15.70 rad/s** | 23.5 / 30.0 |
| joint | `go1.usd` `maxForce` | `go1.usd` `maxJointVelocity` | old
config |
| --- | --- | --- | --- |
| hip / thigh | 23.7 N·m | 1724.6 °/s = 30.1 rad/s | 23.7 / 30.0 |
| calf | **35.55 N·m** | 1149.35 °/s = **20.06 rad/s** | 23.7 / 30.0 |
Both match the official Unitree URDFs exactly
([go2](https://github.com/unitreerobotics/unitree_ros/blob/master/robots/go2_description/urdf/go2_description.urdf),
[go1](https://github.com/unitreerobotics/unitree_ros/blob/master/robots/go1_description/urdf/go1.urdf)),
giving reductions of 1.9169 and 1.5000.
Go1 is affected for the same reason even though it uses an actuator net:
`ActuatorNetMLP` subclasses `DCMotor`, so the network output goes
through the same envelope.
`UNITREE_A1_CFG` was checked and needs no change — `a1.urdf` and
`a1.usd` are both flat at 33.5 N·m / 21.0 rad/s, matching the config.
## Why `saturation_effort` had to change
The calf needs its own *stall* torque, not just its own effort and
velocity limits. `saturation_effort` was the one actuator limit typed as
a bare `float`, so expressing this previously required splitting the
legs into two actuator groups — which changes the `actuators` dict keys
that `go1/rough_env_cfg.py`, `go2/rough_env_cfg.py` and `test_hydra.py`
index by name, and adds a second group to iterate every step.
The first commit resolves it through `resolve_joint_parameter` like
every other limit, so it accepts a joint-name-pattern dict. This is not
a new concept in the codebase: `sim/schemas/schemas_actuators.py`
already expands dict-shaped `saturation_effort` when authoring
`NewtonActuator` prims, so the config type was simply narrower than the
machinery behind it. Scalar configurations are unaffected.
## Note on #7562
@sylvesterkaczmarek filed #7479 and opened #7562 for the Go2 half of
this. That PR takes the second-actuator-group route and derives the calf
values from the reduction ratio (45.05 / 15.65) rather than reading them
off the asset. This PR covers Go1 as well, keeps a single actuator
group, and uses the values already in the USD. Happy to defer if
maintainers prefer the other shape.
## Type of change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
Simulated Go1 and Go2 behavior changes: the calf now produces up to
1.92x more torque and stops motoring at roughly half the previous speed.
Policies trained against the old configuration should be retrained
rather than reused. This is called out in the `isaaclab_assets`
changelog fragment.
## Tests
- `source/isaaclab/test/actuators/test_dc_motor.py` gains
`test_dc_motor_clip_with_per_joint_saturation_effort`, which checks that
a dict-configured two-joint group reproduces, column by column, what a
scalar-configured actuator produces for the same joint. Verified failing
before the fix (`TypeError: unsupported operand type(s) for /: 'Tensor'
and 'dict'`) and passing after.
- `source/isaaclab/test/actuators/test_dc_motor.py` — 170 passed.
- `source/isaaclab/test/actuators/test_actuator_collection.py` — 30
passed.
- `source/isaaclab_assets/test/test_valid_configs.py -k cpu` — 1 passed
(spawns every registered asset, including both Go configs).
- Confirmed the patterns resolve against the real joint names: all four
calf joints get 45.43 / 15.70 (Go2) and 35.55 / 20.06 (Go1); hips and
thighs get 23.7 / 30.1.
No config-literal assertion test was added for `unitree.py` — it would
restate the constants without checking behavior. The behavioral contract
is covered by the DC-motor test above.
## Release backport
- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`
## Checklist
- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there1 parent ec58631 commit 5c78379
7 files changed
Lines changed: 74 additions & 10 deletions
File tree
- docs/source/concepts
- source
- isaaclab_assets
- changelog.d
- isaaclab_assets/robots
- isaaclab
- changelog.d
- isaaclab/actuators
- test/actuators
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
231 | 233 | | |
232 | 234 | | |
233 | 235 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
409 | 411 | | |
410 | 412 | | |
411 | 413 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
174 | | - | |
175 | | - | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
0 commit comments