Skip to content

Fixes inconsistent data reading in body, link, com for RigidObject, RigidObjectCollection and Articulation - #2736

Merged
kellyguo11 merged 4 commits into
mainfrom
feat/fix_data_inconsistencies_in_assets_read
Jun 25, 2025
Merged

kellyguo11 merged 4 commits into
mainfrom
feat/fix_data_inconsistencies_in_assets_read

Conversation

@ooctipus

@ooctipus ooctipus commented Jun 18, 2025 •

Copy link
Copy Markdown
Collaborator

Description

When WriteState, WriteLink, WriteCOM, WriteJoint are invoked, there is a inconsistency when reading values of ReadState, ReadLink, ReadCOM. The Source of the bug is because of missing timestamp invalidation of relative data or missing update to the related data within the write function. Below I list the all functions that is problematics

RigitObject:
write_root_link_pose_to_sim
write_root_com_velocity_to_sim

RigitObjectCollection:
write_object_link_pose_to_sim
write_object_com_velocity_to_sim

Articulation:
write_joint_state_to_sim

The bug if fixed by invalidating the relevant data timestamps in write_joint_state_to_sim function for articulation, and added direct update to the dependent data in write_(state|link|com)_to_sim of RigitObject and RigitObjectCollection.

I have added the tests cases that checks the consistency among ReadState, ReadLink, ReadCOM when either WriteState, WriteLink, WriteCOM, WriteJoint is called and passed all tests.

Fixes #2534 #2702

Type of change

Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have run the pre-commit checks 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

… pos, quat, pose, state when write operation get performed
@ooctipus
ooctipus force-pushed the feat/fix_data_inconsistencies_in_assets_read branch from 79589b7 to 2b78dd5 Compare June 18, 2025 23:23
@ooctipus ooctipus changed the title fix data consistency between body, link, com, and consistency between… fix inconsistent data reading in body, link, com for RigidObject, RigidObjectCollection and Articulation Jun 18, 2025
@kellyguo11 kellyguo11 changed the title fix inconsistent data reading in body, link, com for RigidObject, RigidObjectCollection and Articulation Fixes inconsistent data reading in body, link, com for RigidObject, RigidObjectCollection and Articulation Jun 19, 2025
@kellyguo11

Copy link
Copy Markdown
Contributor

@Mayankm96 @ozhanozen could you please help review this one to make sure it resolves the reported issues?

@ozhanozen

Copy link
Copy Markdown
Contributor

@Mayankm96 @ozhanozen could you please help review this one to make sure it resolves the reported issues?

Hi @kellyguo11, I’d be happy to help.

Quick thought: for pure-derived properties like body_state_w, root_com_pose_w, etc., which only concatenate or apply simple math and don’t call PhysX directly, could we drop their timestamp guards and recompute them on access instead? This would remove a lot of boilerplate and potential timestamp bugs with a negligible perf hit. What do you think?

@ooctipus

Copy link
Copy Markdown
Collaborator Author

Hi @ozhanozen
Your concern is right, I am also not very sure what will be the best design-intent here, @Mayankm96 may have more thoughts on this. What I did is to write tests to ensure the data consistency so that the issue you saw(I also experienced the same issue in RigidBody.write) is tested before future code release. I think the test should be complete, in english, they are testing that for RigidBodies, Articulation, RigidBodiesCollection, root_(state|pos|quat|vel|ang), bodylink_(state|pos|quat|vel|ang), com_(state|pos|quat|vel|ang) must agree after any write operation.

@kellyguo11, feel free to add more input on this matter.

@kellyguo11

Copy link
Copy Markdown
Contributor

I agree it'd be less error-prone to remove the lazy updates if there are no perf hits, though it would be good to profile the operations to make sure there is indeed no impact on the performance before we make that change. Some of the torch operations could still be costly if called many times within a step.

@kellyguo11
kellyguo11 merged commit c75bc5c into main Jun 25, 2025
@kellyguo11
kellyguo11 deleted the feat/fix_data_inconsistencies_in_assets_read branch June 25, 2025 20:40
@jtigue-bdai

Copy link
Copy Markdown
Collaborator

@kellyguo11 did we get a feel for the speed performance from this?

@kellyguo11

Copy link
Copy Markdown
Contributor

IIRC the initial change for optimizing the APIs showed slight performance improvement, but not too significant. @ooctipus did you get to do some performance analysis with the latest changes here?

@jtigue-bdai

Copy link
Copy Markdown
Collaborator

Ok that works. I know these buffers have been monkeyed around with a lot in the last year. I think consistent beets performance

@ooctipus

ooctipus commented Jun 25, 2025 •

Copy link
Copy Markdown
Collaborator Author

I didn't do any formal analysis with code. But I think it is pretty easy to reason it,
last version were invalidating the timestamp where as the mayank's newer version transitions from some timestamp-invalidation to direct buffer modification upon write. This fix is matching the new style.

we basically have 3 ways to do about it:

1: get from physics:
pro: more direct
con: incur expense from physx everytime

2: invalidate time step
pro: save compute time, if that variable is never called
con: not aligning with current code how buffer is directly modified

3: direct update to all buffers (current)
pro: 1 time cost, align with direct buffer modification style in current code.
con: this 1 time cost is incurred every time write is invoked

I think all ways makes sense, and the performance gain is probably very minimum, if that is true, then I think style match can be important factor.

harry-wf-cheung pushed a commit to harry-wf-cheung/IsaacLab-Harry that referenced this pull request Jul 30, 2025
…igidObjectCollection and Articulation (isaac-sim#2736)

# Description
When WriteState, WriteLink, WriteCOM, WriteJoint are invoked, there is a
inconsistency when reading values of ReadState, ReadLink, ReadCOM. The
Source of the bug is because of missing timestamp invalidation of
relative data or missing update to the related data within the write
function. Below I list the all functions that is problematics

RigitObject:
write_root_link_pose_to_sim
write_root_com_velocity_to_sim

RigitObjectCollection:
write_object_link_pose_to_sim
write_object_com_velocity_to_sim

Articulation:
write_joint_state_to_sim

The bug if fixed by invalidating the relevant data timestamps in
write_joint_state_to_sim function for articulation, and added direct
update to the dependent data in write_(state|link|com)_to_sim of
RigitObject and RigitObjectCollection.

I have added the tests cases that checks the consistency among
ReadState, ReadLink, ReadCOM when either WriteState, WriteLink,
WriteCOM, WriteJoint is called and passed all tests.

Fixes isaac-sim#2534 isaac-sim#2702 

<!-- 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)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] 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

<!--
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]>
kellyguo11 added a commit that referenced this pull request Sep 18, 2025
# Description

This PR removes the calls into write simulation after reset_idx,

I think this is not needed anymore because of PR #2736 
Lets see if it passes all test

Fixes # (issue)

<!-- 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 <[email protected]>
kellyguo11 added a commit that referenced this pull request Sep 18, 2025
# Description

This PR removes the calls into write simulation after reset_idx,

I think this is not needed anymore because of PR #2736 
Lets see if it passes all test

Fixes # (issue)

<!-- 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 <[email protected]>
ooctipus added a commit to ooctipus/IsaacLab that referenced this pull request Sep 20, 2025
# Description

This PR removes the calls into write simulation after reset_idx,

I think this is not needed anymore because of PR isaac-sim#2736 
Lets see if it passes all test

Fixes # (issue)

<!-- 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 <[email protected]>
george-nehma pushed a commit to george-nehma/DreamLander-IsaacLab that referenced this pull request Oct 24, 2025
# Description

This PR removes the calls into write simulation after reset_idx,

I think this is not needed anymore because of PR isaac-sim#2736 
Lets see if it passes all test

Fixes # (issue)

<!-- 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 <[email protected]>
LJones-alt pushed a commit to LJones-alt/IsaacLab-Laura that referenced this pull request Jul 1, 2026
…igidObjectCollection and Articulation (isaac-sim#2736)

# Description
When WriteState, WriteLink, WriteCOM, WriteJoint are invoked, there is a
inconsistency when reading values of ReadState, ReadLink, ReadCOM. The
Source of the bug is because of missing timestamp invalidation of
relative data or missing update to the related data within the write
function. Below I list the all functions that is problematics

RigitObject:
write_root_link_pose_to_sim
write_root_com_velocity_to_sim

RigitObjectCollection:
write_object_link_pose_to_sim
write_object_com_velocity_to_sim

Articulation:
write_joint_state_to_sim

The bug if fixed by invalidating the relevant data timestamps in
write_joint_state_to_sim function for articulation, and added direct
update to the dependent data in write_(state|link|com)_to_sim of
RigitObject and RigitObjectCollection.

I have added the tests cases that checks the consistency among
ReadState, ReadLink, ReadCOM when either WriteState, WriteLink,
WriteCOM, WriteJoint is called and passed all tests.

Fixes isaac-sim#2534 isaac-sim#2702 

<!-- 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)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] 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

<!--
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]>
LJones-alt pushed a commit to LJones-alt/IsaacLab-Laura that referenced this pull request Jul 1, 2026
# Description

This PR removes the calls into write simulation after reset_idx,

I think this is not needed anymore because of PR isaac-sim#2736 
Lets see if it passes all test

Fixes # (issue)

<!-- 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 <[email protected]>
csj-275 pushed a commit to csj-275/IsaacLab that referenced this pull request Jul 8, 2026
…igidObjectCollection and Articulation (isaac-sim#2736)

# Description
When WriteState, WriteLink, WriteCOM, WriteJoint are invoked, there is a
inconsistency when reading values of ReadState, ReadLink, ReadCOM. The
Source of the bug is because of missing timestamp invalidation of
relative data or missing update to the related data within the write
function. Below I list the all functions that is problematics

RigitObject:
write_root_link_pose_to_sim
write_root_com_velocity_to_sim

RigitObjectCollection:
write_object_link_pose_to_sim
write_object_com_velocity_to_sim

Articulation:
write_joint_state_to_sim

The bug if fixed by invalidating the relevant data timestamps in
write_joint_state_to_sim function for articulation, and added direct
update to the dependent data in write_(state|link|com)_to_sim of
RigitObject and RigitObjectCollection.

I have added the tests cases that checks the consistency among
ReadState, ReadLink, ReadCOM when either WriteState, WriteLink,
WriteCOM, WriteJoint is called and passed all tests.

Fixes isaac-sim#2534 isaac-sim#2702 

<!-- 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)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] 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

<!--
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]>
csj-275 pushed a commit to csj-275/IsaacLab that referenced this pull request Jul 8, 2026
# Description

This PR removes the calls into write simulation after reset_idx,

I think this is not needed anymore because of PR isaac-sim#2736 
Lets see if it passes all test

Fixes # (issue)

<!-- 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] RIgidObject failed to invalidate timestamp-sensitive data when direct modifying root_pose and root_link_state

4 participants