Fixes outdated sensor data after reset#1276
Conversation
Signed-off-by: Kelly Guo <kellyguo123@hotmail.com>
Signed-off-by: Kelly Guo <kellyguo123@hotmail.com>
Signed-off-by: Kelly Guo <kellyguo123@hotmail.com>
Signed-off-by: Kelly Guo <kellyguo123@hotmail.com>
|
From an understanding standpoint, if a user sets robot state for articulation, isn't the base pose also updated in non-rendering sensors because the "views" capture the same memory. What does the update fabric do? 👀 Also can we have some sort of test to make sure this behavior is always verified (for sensors)? |
| self.set_setting("/app/player/playSimulations", True) | ||
| else: | ||
| # manually flush the fabric data to update Hydra textures | ||
| if self._fabric_iface is not None: |
There was a problem hiding this comment.
Hm this would break non env workflows where users didn't need to call a forward function. Maybe we add a flag on whether forward was called and in-case it wasn't, we do it implicitly?
There was a problem hiding this comment.
This shouldn't actually change any logic right? It's just moving a piece of the code into a method.
I think it's needed for capturing updates from the dof states and propagating those to the bodies. Added a test case for it. |
Signed-off-by: Kelly Guo <kellyg@nvidia.com>
…into sensor_reset
Signed-off-by: Kelly Guo <kellyg@nvidia.com>
# Description This change adds a call to `update_articulations_kinematic()` after performing reset in an environment to ensure that non-render sensors are updated after performing reset. ## 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) ## Checklist - [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 - [ ] 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 <kellyguo123@hotmail.com> Signed-off-by: Kelly Guo <kellyg@nvidia.com>
The kernel-level fix (reset_envs_kernel setting is_outdated=False) broke FrameTransformer's refetch-on-reset behavior that PR isaac-sim#1276 relies on, causing test_outdated_sensor.py to fail in CI. Move the fix into each step-dependent sensor's reset() so it only affects the four sensors that genuinely have a staleness problem (contact / IMU / PVA / joint-wrench across PhysX and Newton); FrameTransformer / RayCaster / Camera keep their original refetch-on-reset semantics. * Revert reset_envs_kernel back to is_outdated=True (PR isaac-sim#1276 contract). * Add clear_outdated_envs_kernel + SensorBase._mark_envs_up_to_date() helper for sensors to opt out of the refetch. * Each affected sensor's reset() now calls _mark_envs_up_to_date(mask) after zeroing _data, so subsequent data access returns those zeros rather than refetching the unstepped physics buffer. * Simplify Newton ContactSensor.reset() to use the shared _resolve_indices_and_mask helper instead of its custom resolution. * Add per-package changelog fragments (isaaclab / isaaclab_physx / isaaclab_newton).
Replace the SensorBase opt-out scaffolding from the previous attempt with
a kernel-level check: each step-dependent sensor's update kernel now
takes the sensor timestamp and early-returns for envs where it is still
0 (the existing reset_envs_kernel signal that no physics step has
occurred since the last reset). Reading the physics buffer for those
envs would inject pre-reset values; the kernel skip keeps the data that
the sensor's reset() populated.
This is a single added argument and a single conditional per affected
kernel — no shared kernel, helper method, or class attribute. Touches:
PhysX: update_net_forces_kernel, imu_update_kernel,
pva_update_kernel, joint_wrench_split_kernel.
Newton: copy_from_newton_kernel, imu_copy_kernel,
pva_update_kernel, joint_wrench_to_incoming_joint_frame_kernel.
FrameTransformer / RayCaster / Camera kernels are untouched so they
continue to refetch right after reset (the path PR isaac-sim#1276 set up).
Description
This change adds a call to
update_articulations_kinematic()after performing reset in an environment to ensure that non-render sensors are updated after performing reset.Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there