-
Notifications
You must be signed in to change notification settings - Fork 3k
Adds physics collision tests #4449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Greptile OverviewGreptile SummaryAdded comprehensive collision behavior test suite with 977 lines of code covering primitive colliders (sphere, box, capsule, cylinder, cone), mesh colliders, and SDF colliders. The test suite includes horizontal collision tests between object pairs verifying momentum transfer, ground collision tests for all shape types, box stacking stability tests for primitive and mesh combinations, sphere bounce restitution tests, momentum conservation tests for equal-mass collisions, and articulated hand per-finger collision isolation tests using the Allegro hand. Key changes:
Test coverage:
The tests are well-structured with helper functions, proper fixtures, and clear assertions. The code follows the existing IsaacLab testing patterns and includes comprehensive documentation. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Test Suite
participant Sim as Simulation Context
participant Scene as Interactive Scene
participant ObjA as Object A
participant ObjB as Object B
participant Physics as Physics Engine
Note over Test: test_horizontal_collision
Test->>Sim: build_simulation_context(device, dt, gravity_enabled=False)
Test->>Scene: InteractiveScene(scene_cfg)
Test->>Scene: Add object_a, object_b configurations
Test->>Sim: Apply SDF collision (if needed)
Test->>Sim: sim.reset()
Test->>Scene: scene.reset()
Test->>ObjA: Set initial velocity (2.0 m/s in X)
Test->>ObjB: Set velocity to zero
loop collision_steps (240 iterations)
Test->>Scene: write_data_to_sim()
Test->>Sim: sim.step(render=False)
Test->>Scene: scene.update(dt)
Test->>Physics: Check collision detection
Test->>Test: Verify no interpenetration
end
Test->>Test: Verify collision occurred
Test->>Test: Verify momentum transfer
Test->>Test: Verify no spurious velocities
Note over Test: test_falling_collision_with_ground
Test->>Sim: build_simulation_context(gravity_enabled=True, add_ground_plane=True)
Test->>Scene: Create object at height 2.0m
loop fall_steps (480 iterations)
Test->>Scene: write_data_to_sim()
Test->>Sim: sim.step()
Test->>Scene: scene.update(dt)
end
Test->>Test: Verify object didn't fall through ground
Test->>Test: Verify object came to rest
Note over Test: test_finger_collision_isolation
Test->>Sim: build_simulation_context(gravity_enabled=True)
Test->>Scene: Create Allegro hand (gravity disabled)
Test->>Scene: Create sphere above target finger
Test->>Sim: Apply SDF collision (if needed)
loop settle_steps (30 iterations)
Test->>Scene: Let hand settle
end
Test->>Test: Record initial joint positions
loop drop_steps (480 iterations)
Test->>Scene: Simulate sphere drop
Test->>Test: Track peak deflection per finger
end
Test->>Test: Verify target finger deflected significantly
Test->>Test: Verify target finger had highest deflection
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No files reviewed, no comments
Description
This PR adds a comprehensive collision behavior test suite for Isaac Lab, inspired by the Newton physics engine collision tests. The test suite ensures that objects created with different colliders exhibit expected and understandable behavior.
Key features:
Test coverage includes:
The tests are designed to avoid initial interpenetration of collision objects, which can cause undefined behavior in physics engines.
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there