Fix Newton deformables demo self-contact configuration#5744
Conversation
There was a problem hiding this comment.
Isaac Lab Review Bot 🤖
Thanks for the contribution! I've analyzed PR #5744 and have the following observations:
Summary
This PR enables particle self-contact in the Newton VBD solver configuration for the deformables demo, which should resolve the particle inter-penetration issue (NVBUG 6201420).
Findings
1. [Low] Consider documenting the parameter tuning rationale
File: scripts/demos/deformables.py (lines 245-252)
The new parameters (particle_self_contact_radius=0.0001, particle_self_contact_margin=0.1, iterations=5) appear to be empirically tuned values. Consider adding a brief comment explaining:
- Why iterations was reduced from 10 to 5
- The relationship between
particle_self_contact_radiusandparticle_self_contact_margin - What scale/units these values assume (e.g., are they in meters?)
This helps future maintainers understand the tuning decisions.
physics_cfg = NewtonCfg(
solver_cfg=VBDSolverCfg(
iterations=5, # Consider adding: "reduced from 10 for performance; sufficient with self-contact enabled"
particle_enable_self_contact=True,
particle_self_contact_radius=0.0001, # meters? document units
particle_self_contact_margin=0.1, # relative margin for contact detection
),
num_substeps=4,
)2. [Info] PR contains squashed commits from other PRs
This PR appears to contain commits from multiple unrelated PRs that were squashed into the branch:
- #5713 (test environment speed improvements)
- #5714 (docs release branch updates)
- #5716 (teleop replay agent refactoring)
- Automated changelog compilations
While this is likely due to branch synchronization with the base branch, it makes the PR diff larger than the actual changes for this fix (32 files changed vs. the 1 file that contains the actual fix).
3. [Info] Missing changelog fragment for the deformables fix
The PR description indicates this is a bug fix, but I don't see a new changelog fragment specifically for the deformables self-contact fix. The existing changelog entries in this PR are from the squashed/merged commits.
Consider adding a changelog fragment like:
source/isaaclab_newton/changelog.d/fix-deformables-self-contact.rst
Fixed
^^^^^
* Fixed particle self-contact configuration in the Newton deformables demo to prevent inter-penetration.4. [Low] Test coverage for the deformables demo configuration
The scripts/demos/deformables.py file doesn't appear to have dedicated unit tests. While the environment smoke tests may exercise this code path, consider whether the specific Newton VBD solver configuration should have explicit validation tests to catch configuration regressions.
CI Status
⚠️ Check changelog fragments: failing (expected - needs changelog fragment for this fix)- ✅ Pre-commit checks: passing
- ⏳ Installation tests: pending
Overall
The core fix is straightforward and targeted. The main suggestions are around documentation and test coverage to help with long-term maintainability.---
Update (99def4e): Re-reviewed after new commits.
✅ Finding #3 addressed: Changelog fragment source/isaaclab_newton/changelog.d/fix-deformables-self-contact.rst has been added with the exact fix description I suggested.
The remaining findings are informational/low priority suggestions. The PR now looks good to merge:
- Core fix is correct:
particle_enable_self_contact=Truewith appropriate radius/margin values - Proper changelog entry included
- CI should pass once changelog check reruns
Greptile SummaryThis PR fixes the Newton VBD deformables demo by enabling particle self-contact and tuning the contact radius/margin. It also ships improvements to
Confidence Score: 4/5Safe to merge; the deformables bug fix and teleop improvements are well-scoped and carry no breaking runtime risk. The deformables fix is a straightforward config change targeting a specific solver bug. The teleop stats changes are additive and contain good defensive null-handling. The only meaningful concern is that cpu_frame_time_ms and fps fields silently change units while schema_version stays at 1, which may surprise downstream consumers of the JSON report. teleop_replay_agent.py (schema version vs. semantic change) and env_test_utils.py (dead exception handler) Important Files Changed
|
| try: | ||
| term = getattr(events_cfg, term_name, None) | ||
| except AttributeError: | ||
| continue |
There was a problem hiding this comment.
Redundant
except AttributeError around a three-argument getattr
The three-argument form getattr(obj, name, default) already silently swallows AttributeError raised inside property getters and returns the default — it never raises AttributeError to the caller. The try/except AttributeError block is therefore dead code. More importantly, if any property getter on events_cfg raises a non-AttributeError exception (e.g. RuntimeError, TypeError), that exception will propagate uncaught and abort the test-setup loop unexpectedly. Either remove the dead handler or broaden it to except Exception to match the intent.
| ``sim.render.antialiasing_mode``) along with precomputed ``policy_dt_s``, | ||
| ``render_dt_s``, ``renders_per_step``, ``target_policy_hz``, and | ||
| ``target_render_hz`` rates. The same fields are echoed in a compact | ||
| ``Env timing:`` line in the stdout summary so the measured | ||
| ``cpu_frame_time_ms`` / ``fps`` numbers are self-interpreting across |
There was a problem hiding this comment.
Stale "Kit" reference in the changelog entry
The Changed-section description still says "the number of Kit renders per env.step", while every other occurrence of "Kit" in the same PR was replaced with "simulator". Minor inconsistency but worth aligning for a clean release note.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
1afda23 to
2c3125f
Compare
2c3125f to
32a73b4
Compare
Description
Enable particle self-contact in the Newton VBD solver config used by the deformables demo, and tune the contact radius/margin so particles don't inter-penetrate.
Fixes NVBUG 6201420
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there