Changes Quaternion convention from WXYZ to XYZW#4437
Conversation
|
Skipped: This PR changes more files than the configured file change limit: ( |
… partially failing. Something is off.
3ce9a3e to
43375fc
Compare
|
@njawale42 @peterd-NV @michaellin6 fyi - we'll likely need to update the curobo, mimic, and IK tests with these changes. |
|
@ooctipus could you check the fabric stuff? I think I may have used the wrong ordering, but it still passes the tests somehow? |
|
@kellyguo11 Looks like the regular test suites are passing. Do you know if we could run the whole set of tests on this PR? |
|
I think fabric looks right! |
4a93cf3 to
7ad2392
Compare
|
latest CI run seems to have a lot more test failures in the camera classes and test_views_xform_prim and some other places. are these from recent updates to develop? also linter check is failing. |
|
I just merged develop and fixed a couple things. It looks like almost everything is passing now? |
|
I took a quick look at the Pink IK related tests and env scripts, and the quat conventions have been updated correctly. If test_pink_ik.py is passing then it should be good on that side. |
|
Thanks @michaellin6! looks like all the other failing ones are in the mimic extension now, we can probably disable those until mimic migrates to 3.0. not sure why the factory environment test is timing out though. does that one run fine locally? |
|
@AntoineRichard submitted a fix to your branch for the factory environments - AntoineRichard#6. let's merge this in once that's there |
Fixes quaternion issues with factory environments
Thanks @kellyguo11 . It looks like they use the isaacsim math utils. Should we ask someone to change to our internal helpers? |
|
Looks like the tests are getting datasets generate in WXYZ formats :/. I can make a utility to help convert the old datasets, but eventually we'll have to regenerate them. @kellyguo11 |
Signed-off-by: Kelly Guo <kellyg@nvidia.com>
# Description Changes the quaternion convention in IsaacLab to match that of: - ROS - PhysX - Newton - Scipy - Low level USD Fixes isaac-sim/IsaacLab-Internal#744 This PR brings massive changes throughout the code base. Almost all users should expect their code to be impacted by these changes. We provide a tool that should help users navigate these changes. `./scripts/tools/find_quaternions.py` provides users with an automated script to search throughout the code base some quaternions that do not differ between the current code and a given commit. This can be used to track if your code has changed the order of its hard-coded quaternions. For instance running the following will show all the quaternions that might need to be updated inside your extension. The dry-run flag will make it so that the script does not attempt to modify the quaternions. ``` ./scripts/tools/find_quaternions.py --path PATH_TO_YOUR_EXTENSION --all-quats --fix --context 4 --dry-run ``` If you want to modify the quaternions the script comes with an interactive mode where it prompts you with changes to be made, to do so remove the `--dry-run` flag: ``` ./scripts/tools/find_quaternions.py --path PATH_TO_YOUR_EXTENSION --all-quats --fix --context 4 ``` The `--context` flag provides more or less context before and after the line where a quaternion was found. Here is a sample of the interactive mode: ```shell Searching 968 Python, 11 JSON, and 6 RST files... Comparing against: main Found 178 files changed from main Found 69 potential quaternions to review: ==================================================================================================== ──────────────────────────────────────────────────────────────────────────────── 📍 source/isaaclab_assets/isaaclab_assets/robots/anymal.py:173 [AMBIGUOUS] ──────────────────────────────────────────────────────────────────────────────── 169 | # Configuration - Sensors. 170 | ## 171 | 172 | ANYMAL_LIDAR_CFG = VELODYNE_VLP_16_RAYCASTER_CFG.replace( >>> 173 | offset=RayCasterCfg.OffsetCfg(pos=(-0.310, 0.000, 0.159), rot=(0.0, 0.0, 0.0, 1.0)) 174 | ) 175 | """Configuration for the Velodyne VLP-16 sensor mounted on the ANYmal robot's base.""" ──────────────────────────────────────────────────────────────────────────────── Change: [0.0, 0.0, 0.0, 1.0] → [0.0, 0.0, 1.0, 0.0] Result: offset=RayCasterCfg.OffsetCfg(pos=(-0.310, 0.000, 0.159), rot=(0.0, 0.0, 1.0, 0.0)) Apply this fix? [Y/n/a/q]: Y ✅ Fixed! ──────────────────────────────────────────────────────────────────────────────── 📍 source/isaaclab_mimic/test/test_curobo_planner_franka.py:42 [AMBIGUOUS] ──────────────────────────────────────────────────────────────────────────────── 38 | 39 | # Predefined EE goals for the test 40 | # Each entry is a tuple of: (goal specification, goal ID) 41 | predefined_ee_goals_and_ids = [ >>> 42 | ({"pos": [0.70, -0.25, 0.25], "quat": [0.0, 0.707, 0.0, 0.707]}, "Behind wall, left"), 43 | ({"pos": [0.70, 0.25, 0.25], "quat": [0.0, 0.707, 0.0, 0.707]}, "Behind wall, right"), 44 | ({"pos": [0.65, 0.0, 0.45], "quat": [1.0, 0.0, 0.0, 0.0]}, "Behind wall, center, high"), 45 | ({"pos": [0.80, -0.15, 0.35], "quat": [0.0, 0.5, 0.0, 0.866]}, "Behind wall, far left"), 46 | ({"pos": [0.80, 0.15, 0.35], "quat": [0.0, 0.5, 0.0, 0.866]}, "Behind wall, far right"), ──────────────────────────────────────────────────────────────────────────────── Change: [0.0, 0.707, 0.0, 0.707] → [0.707, 0.0, 0.707, 0.0] Result: ({"pos": [0.70, -0.25, 0.25], "quat": [0.707, 0.0, 0.707, 0.0]}, "Behind wall, left"), Apply this fix? [Y/n/a/q]: Y ✅ Fixed! ──────────────────────────────────────────────────────────────────────────────── 📍 source/isaaclab_mimic/test/test_curobo_planner_franka.py:43 [AMBIGUOUS] ──────────────────────────────────────────────────────────────────────────────── 39 | # Predefined EE goals for the test 40 | # Each entry is a tuple of: (goal specification, goal ID) 41 | predefined_ee_goals_and_ids = [ 42 | ({"pos": [0.70, -0.25, 0.25], "quat": [0.707, 0.0, 0.707, 0.0]}, "Behind wall, left"), >>> 43 | ({"pos": [0.70, 0.25, 0.25], "quat": [0.0, 0.707, 0.0, 0.707]}, "Behind wall, right"), 44 | ({"pos": [0.65, 0.0, 0.45], "quat": [1.0, 0.0, 0.0, 0.0]}, "Behind wall, center, high"), 45 | ({"pos": [0.80, -0.15, 0.35], "quat": [0.0, 0.5, 0.0, 0.866]}, "Behind wall, far left"), 46 | ({"pos": [0.80, 0.15, 0.35], "quat": [0.0, 0.5, 0.0, 0.866]}, "Behind wall, far right"), 47 | ] ──────────────────────────────────────────────────────────────────────────────── Change: [0.0, 0.707, 0.0, 0.707] → [0.707, 0.0, 0.707, 0.0] Result: ({"pos": [0.70, 0.25, 0.25], "quat": [0.707, 0.0, 0.707, 0.0]}, "Behind wall, right"), Apply this fix? [Y/n/a/q]: Y ✅ Fixed! ``` ## Type of change - Breaking change (existing functionality will not work without user modification) - Documentation update ## 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 updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Kelly Guo <kellyg@nvidia.com> Co-authored-by: Kelly Guo <kellyg@nvidia.com>
…#5754) # Description `scripts/imitation_learning/locomanipulation_sdg/gr00t/convert_dataset.py` still passed `scalar_first=True` to `Rotation.from_quat` / `as_quat`, but since #4437 (Jan 2026) Isaac Lab returns body poses in XYZW. The script therefore mis-interpreted recorded poses as WXYZ, corrupting every relative-pose computation (hands, object, fixture, goal) in the GR00T training data and causing trained policies to produce twisted-arm rollouts. <!-- As a practice, it is recommended to open an issue to have discussions on the proposed pull request. This makes it easier for the community to keep track of what is being developed or added, and if a given feature is demanded by more than one party. --> ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) ## Screenshots Please attach before and after screenshots of the change if applicable. <!-- Example: | Before | After | | ------ | ----- | | _gif/png before_ | _gif/png after_ | To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections. --> ## Checklist - [ ] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> Co-authored-by: Kelly Guo <kellyg@nvidia.com>
Description
Changes the quaternion convention in IsaacLab to match that of:
Fixes https://github.com/isaac-sim/IsaacLab-Internal/issues/744
This PR brings massive changes throughout the code base. Almost all users should expect their code to be impacted by these changes. We provide a tool that should help users navigate these changes.
./scripts/tools/find_quaternions.pyprovides users with an automated script to search throughout the code base some quaternions that do not differ between the current code and a given commit. This can be used to track if your code has changed the order of its hard-coded quaternions.For instance running the following will show all the quaternions that might need to be updated inside your extension. The dry-run flag will make it so that the script does not attempt to modify the quaternions.
If you want to modify the quaternions the script comes with an interactive mode where it prompts you with changes to be made, to do so remove the
--dry-runflag:The
--contextflag provides more or less context before and after the line where a quaternion was found.Here is a sample of the interactive mode:
Searching 968 Python, 11 JSON, and 6 RST files... Comparing against: main Found 178 files changed from main Found 69 potential quaternions to review: ==================================================================================================== ──────────────────────────────────────────────────────────────────────────────── 📍 source/isaaclab_assets/isaaclab_assets/robots/anymal.py:173 [AMBIGUOUS] ──────────────────────────────────────────────────────────────────────────────── 169 | # Configuration - Sensors. 170 | ## 171 | 172 | ANYMAL_LIDAR_CFG = VELODYNE_VLP_16_RAYCASTER_CFG.replace( >>> 173 | offset=RayCasterCfg.OffsetCfg(pos=(-0.310, 0.000, 0.159), rot=(0.0, 0.0, 0.0, 1.0)) 174 | ) 175 | """Configuration for the Velodyne VLP-16 sensor mounted on the ANYmal robot's base.""" ──────────────────────────────────────────────────────────────────────────────── Change: [0.0, 0.0, 0.0, 1.0] → [0.0, 0.0, 1.0, 0.0] Result: offset=RayCasterCfg.OffsetCfg(pos=(-0.310, 0.000, 0.159), rot=(0.0, 0.0, 1.0, 0.0)) Apply this fix? [Y/n/a/q]: Y ✅ Fixed! ──────────────────────────────────────────────────────────────────────────────── 📍 source/isaaclab_mimic/test/test_curobo_planner_franka.py:42 [AMBIGUOUS] ──────────────────────────────────────────────────────────────────────────────── 38 | 39 | # Predefined EE goals for the test 40 | # Each entry is a tuple of: (goal specification, goal ID) 41 | predefined_ee_goals_and_ids = [ >>> 42 | ({"pos": [0.70, -0.25, 0.25], "quat": [0.0, 0.707, 0.0, 0.707]}, "Behind wall, left"), 43 | ({"pos": [0.70, 0.25, 0.25], "quat": [0.0, 0.707, 0.0, 0.707]}, "Behind wall, right"), 44 | ({"pos": [0.65, 0.0, 0.45], "quat": [1.0, 0.0, 0.0, 0.0]}, "Behind wall, center, high"), 45 | ({"pos": [0.80, -0.15, 0.35], "quat": [0.0, 0.5, 0.0, 0.866]}, "Behind wall, far left"), 46 | ({"pos": [0.80, 0.15, 0.35], "quat": [0.0, 0.5, 0.0, 0.866]}, "Behind wall, far right"), ──────────────────────────────────────────────────────────────────────────────── Change: [0.0, 0.707, 0.0, 0.707] → [0.707, 0.0, 0.707, 0.0] Result: ({"pos": [0.70, -0.25, 0.25], "quat": [0.707, 0.0, 0.707, 0.0]}, "Behind wall, left"), Apply this fix? [Y/n/a/q]: Y ✅ Fixed! ──────────────────────────────────────────────────────────────────────────────── 📍 source/isaaclab_mimic/test/test_curobo_planner_franka.py:43 [AMBIGUOUS] ──────────────────────────────────────────────────────────────────────────────── 39 | # Predefined EE goals for the test 40 | # Each entry is a tuple of: (goal specification, goal ID) 41 | predefined_ee_goals_and_ids = [ 42 | ({"pos": [0.70, -0.25, 0.25], "quat": [0.707, 0.0, 0.707, 0.0]}, "Behind wall, left"), >>> 43 | ({"pos": [0.70, 0.25, 0.25], "quat": [0.0, 0.707, 0.0, 0.707]}, "Behind wall, right"), 44 | ({"pos": [0.65, 0.0, 0.45], "quat": [1.0, 0.0, 0.0, 0.0]}, "Behind wall, center, high"), 45 | ({"pos": [0.80, -0.15, 0.35], "quat": [0.0, 0.5, 0.0, 0.866]}, "Behind wall, far left"), 46 | ({"pos": [0.80, 0.15, 0.35], "quat": [0.0, 0.5, 0.0, 0.866]}, "Behind wall, far right"), 47 | ] ──────────────────────────────────────────────────────────────────────────────── Change: [0.0, 0.707, 0.0, 0.707] → [0.707, 0.0, 0.707, 0.0] Result: ({"pos": [0.70, 0.25, 0.25], "quat": [0.707, 0.0, 0.707, 0.0]}, "Behind wall, right"), Apply this fix? [Y/n/a/q]: Y ✅ Fixed!Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there