Commit a31ae1a
Support OVPhysX in randomize_rigid_body_collider_offsets MDP event (#7569)
# Description
> **Stacked on #7563.** This branch needs the `REST_OFFSET` /
`CONTACT_OFFSET` / `RIGID_BODY_*_OFFSET` aliases and the CPU-only
routing for those tensor types that #7563 adds. Review/merge that first;
this diff collapses to a single commit once it lands, at which point the
base should be retargeted to `develop`.
`randomize_rigid_body_collider_offsets` had no OVPhysX implementation.
Its backend dispatch tested only for `"newton"` and fell through a bare
`else` to `_RandomizeRigidBodyColliderOffsetsPhysx`, which calls
`get_rest_offsets` / `get_contact_offsets` / `set_rest_offsets` /
`set_contact_offsets` on `asset.root_view`. On OVPhysX that view is an
`OvPhysxView`, which defines none of them, so adding the term to a
config raised `AttributeError` during `OvPhysxManager.reset()` (via
`PHYSICS_READY`) and the environment never built. The error surfaced
from inside the PhysX implementation, so it did not name the unsupported
backend either.
Found by the OVQA agent harness on Isaac-Cartpole (release/3.0.0,
ovphysx 0.5.11). No shipped task uses the term today, so this is latent
rather than a live regression.
**Fix**
- New `_RandomizeRigidBodyColliderOffsetsOvPhysx`, mirroring the PhysX
variant. OVPhysX runs the PhysX solver, so rest/contact offsets are
written directly, per collision shape, through the asset's
`OvPhysxView`: `REST_OFFSET` / `CONTACT_OFFSET` for articulations,
`RIGID_BODY_REST_OFFSET` / `RIGID_BODY_CONTACT_OFFSET` for rigid
objects. Both bindings are CPU-resident `[N, S]` buffers, so the full
tensor is read-modify-written on the host with the selected envs as
write indices.
- Dispatch now matches `randomize_rigid_body_material` in the same file:
`ovphysxmanager` first (it contains the substring `physx`), then Newton,
then PhysX, and a `ValueError` naming the manager for anything else
instead of silently selecting PhysX.
- Docstring lists OVPhysX as a supported backend.
**Note on write order**
PhysX enforces `restOffset < contactOffset` and on OVPhysX a violating
`setRestOffset` is only logged, not raised. The term writes rest before
contact, same as the PhysX variant, so raising both above a small
authored contact offset can silently skip the rest write. Kept for PhysX
parity; flagging in case we want to reorder in both backends.
**Verification**
New
`source/isaaclab_ov/test/test_randomize_rigid_body_collider_offsets_mdp.py`
drives the public term (stubbed `cfg` / `env` / `asset_cfg`) against a
real OVPhysX `RigidObject` and `Articulation`, so the dispatch itself is
covered. It reproduced the reported `AttributeError` before the fix.
Assertions: selected envs land in the sampled range, unselected envs are
untouched, and omitting one distribution leaves that offset alone.
Passes on `cuda:0` and `cpu` (separate processes, ovphysx device lock).
PhysX and Newton paths are unchanged.
Dependencies: #7563.
Fixes # (no tracking issue; reported by the OVQA agent harness)
## Type of change
- Bug fix (non-breaking change which fixes an issue)
## Release backport
- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`
## Screenshots
Not applicable: no visual change.
## Checklist
Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.
- [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 (do **not** edit
`CHANGELOG.rst` or bump `extension.toml` — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
---------
Co-authored-by: Kelly Guo <kellyg@nvidia.com>
(cherry picked from commit 1b182e7)1 parent 01ca2ad commit a31ae1a
4 files changed
Lines changed: 281 additions & 5 deletions
File tree
- source
- isaaclab_ov
- changelog.d
- test
- isaaclab
- changelog.d
- isaaclab/envs/mdp
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1048 | 1120 | | |
1049 | 1121 | | |
1050 | 1122 | | |
| |||
1129 | 1201 | | |
1130 | 1202 | | |
1131 | 1203 | | |
1132 | | - | |
| 1204 | + | |
1133 | 1205 | | |
1134 | 1206 | | |
1135 | 1207 | | |
1136 | 1208 | | |
| 1209 | + | |
| 1210 | + | |
1137 | 1211 | | |
1138 | 1212 | | |
1139 | 1213 | | |
| |||
1143 | 1217 | | |
1144 | 1218 | | |
1145 | 1219 | | |
1146 | | - | |
| 1220 | + | |
1147 | 1221 | | |
1148 | 1222 | | |
1149 | 1223 | | |
| |||
1171 | 1245 | | |
1172 | 1246 | | |
1173 | 1247 | | |
1174 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1175 | 1252 | | |
1176 | | - | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1177 | 1256 | | |
1178 | | - | |
| 1257 | + | |
1179 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
1180 | 1261 | | |
1181 | 1262 | | |
1182 | 1263 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 185 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
0 commit comments