Repository navigation
Adds Newton sensor simulation interfaces - #4707
Merged
kellyguo11 merged 14 commits intoFeb 25, 2026
Merged
Conversation
AntoineRichard
requested review from
Mayankm96,
jtigue-bdai,
kellyguo11,
ooctipus and
pascal-roth
as code owners
February 24, 2026 13:31
Contributor
Greptile SummaryThis PR introduces Newton-compatible sensor simulation interfaces by migrating the sensor architecture from torch-based to warp-based computation. Key architectural changes:
Sensor-specific updates:
API improvements:
The refactor maintains backward compatibility while enabling future Newton physics backend integration through a clean warp-based abstraction layer. Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SensorBase] -->|inherits| B[BaseContactSensor]
A -->|inherits| C[BaseImu]
A -->|inherits| D[BaseFrameTransformer]
B -->|PhysX impl| E[ContactSensor]
C -->|PhysX impl| F[Imu]
D -->|PhysX impl| G[FrameTransformer]
A -->|uses| H[base kernels.py]
E -->|uses| I[contact_sensor/kernels.py]
F -->|uses| J[imu/kernels.py]
G -->|uses| K[frame_transformer/kernels.py]
H -->|Warp kernels| L[update_timestamp_kernel]
H -->|Warp kernels| M[reset_envs_kernel]
H -->|Warp kernels| N[update_outdated_envs_kernel]
I -->|Warp kernels| O[update_net_forces_kernel]
I -->|Warp kernels| P[split_flat_pose_to_pos_quat]
J -->|Warp kernels| Q[imu_update_kernel]
J -->|Warp kernels| R[imu_reset_kernel]
K -->|Warp kernels| S[frame_transformer_update_kernel]
style A fill:#e1f5ff
style H fill:#ffe1e1
style I fill:#ffe1e1
style J fill:#ffe1e1
style K fill:#ffe1e1
Last reviewed commit: dd1045c |
…tten in warp but they get their updates from warp now.
AntoineRichard
force-pushed
the
antoiner/newton_sensors
branch
from
February 24, 2026 15:39
97812ec to
9d86ea7
Compare
Collaborator
Author
1 of 7 tasks
Signed-off-by: Kelly Guo <[email protected]>
Signed-off-by: Kelly Guo <[email protected]>
ooctipus
approved these changes
Feb 25, 2026
7 tasks
kellyguo11
added a commit
that referenced
this pull request
Feb 25, 2026
# Description #4707 broke tiled camera <!-- 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) - New feature (non-breaking change which adds functionality) - Breaking change (existing functionality will not work without user modification) - Documentation update ## 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 --> --------- Signed-off-by: Kelly Guo <[email protected]> Co-authored-by: Kelly Guo <[email protected]>
8 tasks done
kellyguo11
pushed a commit
that referenced
this pull request
Sep 7, 2026
… ages (#7574) # Description `ContactSensor.compute_first_contact(dt)` / `compute_first_air(dt)` silently missed most touchdowns and lift-offs once the simulation had run for a few seconds. On a transition step the contact (resp. air) timer is exactly one sensor update interval, so the check degenerated to `dt < dt + 1e-8`. The sensor clock is a float32 accumulator whose rounding error reaches ~1e-6 after a few seconds of simulated time, roughly 100x the default tolerance, so the events vanished depending on the magnitude of the sim clock. The reporter's CPU reproducer shows 352/500 touchdowns and lift-offs missed at the default tolerance; it reproduces exactly on `develop`. All three backends (Newton, PhysX, OVPhysX) share the same logic, and the 2.x torch sensor had the same defect, so this is long-standing rather than a Newton regression. **Fix.** `abs_tol` now defaults to `None` and is resolved at call time by a single helper in `BaseContactSensor` to **half the sensor update interval**, i.e. `0.5 * max(cfg.update_period, physics_dt)`. Valid timer values are integer multiples of that interval, so half an interval is the midpoint between "one update ago" and "two updates ago". This stays robust to float32 clock drift for hours of simulated time and works for both `history_length == 0` (lazy, once-per-policy-step refresh) and `history_length > 0` (every physics substep). The Warp kernels are unchanged. Passing an explicit `abs_tol` still works; callers who want the previous behaviour can pass `abs_tol=1e-8`. **Tests.** Public-API regression tests in the Newton, PhysX and OVPhysX contact sensor suites: settle a body in contact, age the sensor clock to 2.5 / 10 / 30 s, lift and land the body, and poll `compute_first_contact` / `compute_first_air` with default arguments. These fail on the unfixed code (e.g. `compute_first_air missed the lift-off at clock 2.833s: reported [], expected [0]`) and pass with the fix. The Newton variant covers both `history_length` modes. **Refresh before query.** Both methods now call the sensor's outdated-buffer refresh before comparing, restoring what the 2.x torch sensor did by reading through `self.data`. The Warp port (#4707 / #4716) read the private timer buffer directly, so a `history_length == 0` caller that polled before touching `data` saw the previous step's timers. The aged-clock tests now poll before reading `data`; the Newton lazy-mode cases fail without the refresh (transition reported one policy step late) and pass with it. Adopted from the approach in #7294. **Out of scope, noted for follow-up.** - The transition interval is counted in both the ending and the starting phase, so `last_air_time` / `last_contact_time` overestimate each phase by one update interval (also raised in the issue). That bias is present since 2.x and baked into tuned `feet_air_time` thresholds, so changing it would rescale rewards for trained velocity policies and deserves its own PR. - On `cuda:0` with `history_length == 0`, the PhysX and OVPhysX sensors serve stale net forces when buffers refresh only on data access, independently of this change. That is why the PhysX/OVPhysX public-API tests cover only the substep cadence. Fixes #7283 ## 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` ## 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 (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
isaaclab-bot Bot
pushed a commit
that referenced
this pull request
Sep 7, 2026
… ages (#7574) # Description `ContactSensor.compute_first_contact(dt)` / `compute_first_air(dt)` silently missed most touchdowns and lift-offs once the simulation had run for a few seconds. On a transition step the contact (resp. air) timer is exactly one sensor update interval, so the check degenerated to `dt < dt + 1e-8`. The sensor clock is a float32 accumulator whose rounding error reaches ~1e-6 after a few seconds of simulated time, roughly 100x the default tolerance, so the events vanished depending on the magnitude of the sim clock. The reporter's CPU reproducer shows 352/500 touchdowns and lift-offs missed at the default tolerance; it reproduces exactly on `develop`. All three backends (Newton, PhysX, OVPhysX) share the same logic, and the 2.x torch sensor had the same defect, so this is long-standing rather than a Newton regression. **Fix.** `abs_tol` now defaults to `None` and is resolved at call time by a single helper in `BaseContactSensor` to **half the sensor update interval**, i.e. `0.5 * max(cfg.update_period, physics_dt)`. Valid timer values are integer multiples of that interval, so half an interval is the midpoint between "one update ago" and "two updates ago". This stays robust to float32 clock drift for hours of simulated time and works for both `history_length == 0` (lazy, once-per-policy-step refresh) and `history_length > 0` (every physics substep). The Warp kernels are unchanged. Passing an explicit `abs_tol` still works; callers who want the previous behaviour can pass `abs_tol=1e-8`. **Tests.** Public-API regression tests in the Newton, PhysX and OVPhysX contact sensor suites: settle a body in contact, age the sensor clock to 2.5 / 10 / 30 s, lift and land the body, and poll `compute_first_contact` / `compute_first_air` with default arguments. These fail on the unfixed code (e.g. `compute_first_air missed the lift-off at clock 2.833s: reported [], expected [0]`) and pass with the fix. The Newton variant covers both `history_length` modes. **Refresh before query.** Both methods now call the sensor's outdated-buffer refresh before comparing, restoring what the 2.x torch sensor did by reading through `self.data`. The Warp port (#4707 / #4716) read the private timer buffer directly, so a `history_length == 0` caller that polled before touching `data` saw the previous step's timers. The aged-clock tests now poll before reading `data`; the Newton lazy-mode cases fail without the refresh (transition reported one policy step late) and pass with it. Adopted from the approach in #7294. **Out of scope, noted for follow-up.** - The transition interval is counted in both the ending and the starting phase, so `last_air_time` / `last_contact_time` overestimate each phase by one update interval (also raised in the issue). That bias is present since 2.x and baked into tuned `feet_air_time` thresholds, so changing it would rescale rewards for trained velocity policies and deserves its own PR. - On `cuda:0` with `history_length == 0`, the PhysX and OVPhysX sensors serve stale net forces when buffers refresh only on data access, independently of this change. That is why the PhysX/OVPhysX public-API tests cover only the substep cadence. Fixes #7283 ## 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` ## 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 (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 (cherry picked from commit 4cf35cc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the simulation interfaces for newton sensors.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there