Fix MockSensorContact to match Newton's nested sensing_objs structure#4925
Merged
kellyguo11 merged 2 commits intoisaac-sim:developfrom Mar 11, 2026
Conversation
Contributor
Greptile SummaryThis PR fixes
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Unit Test
participant Mock as MockNewtonContactSensor
participant CS as ContactSensor._create_buffers()
Test->>Mock: MockNewtonContactSensor(num_sensing_objs, num_counterparts)
Note over Mock: sensing_objs = [[(i,1) for i in range(n)]]<br/>counterparts = [[(i,1) for i in range(m)]]
Test->>CS: _create_buffers()
CS->>Mock: contact_view.sensing_objs
Mock-->>CS: list[list[tuple[int,int]]]
CS->>CS: flat_sensing = [obj for world_objs in sensing_objs for obj in world_objs]
Note over CS: Double-loop flattening works correctly
CS->>Mock: contact_view.counterparts
Mock-->>CS: list[list[tuple[int,int]]]
CS->>CS: flat_counterparts = [obj for world_objs in counterparts for obj in world_objs]
Note over CS: Double-loop flattening works correctly
CS-->>Test: Buffers initialized successfully
Last reviewed commit: 94e5969 |
94e5969 to
ade524c
Compare
ade524c to
6b8218d
Compare
kellyguo11
approved these changes
Mar 11, 2026
daniela-hase
pushed a commit
to daniela-hase/IsaacLab
that referenced
this pull request
Mar 30, 2026
…isaac-sim#4925) # Description the test is using old newton contact sensor api, and new api only accepts nested list structure. Fixes isaac-sim#4908 ## Type of change - Bug fix (non-breaking change which fixes an issue) ## 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` - [ ] I have made corresponding changes to the documentation - [x] 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 - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there Co-authored-by: Kelly Guo <kellyg@nvidia.com>
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
the test is using old newton contact sensor api, and new api only accepts nested list structure.
Fixes #4908
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there