Skip to content

Example IK Custom: Tune avoidance objective parameters#2371

Merged
adenzler-nvidia merged 1 commit intonewton-physics:mainfrom
camevor:ik-avoid-weight
Apr 9, 2026
Merged

Example IK Custom: Tune avoidance objective parameters#2371
adenzler-nvidia merged 1 commit intonewton-physics:mainfrom
camevor:ik-avoid-weight

Conversation

@camevor
Copy link
Copy Markdown
Member

@camevor camevor commented Apr 8, 2026

Description

Tune the parameters for the avoidance objective to reduce the margin and make the object avoidance behavior more interesting.

  • Increase the radii of two robot links to better capture the geometry
  • Decrease the softplus margin and the avoidance objective weight

resolves #2364

Checklist

  • New or existing tests cover these changes
  • The documentation is up to date with these changes
  • CHANGELOG.md has been updated (if user-facing change)

Bug fix

See #2364

Screencast_Example_IK.webm

Summary by CodeRabbit

  • Chores
    • Adjusted collision detection parameters in the inverse kinematics example, including penetration penalty smoothing and collision sphere configuration.
    • Modified collision objective weighting in the optimization process.

@camevor camevor requested a review from dylanturpin April 8, 2026 13:55
@camevor camevor self-assigned this Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 0d7f374f-e826-4b23-a86d-6f6d0f1dfabc

📥 Commits

Reviewing files that changed from the base of the PR and between deb03fe and 342b468.

📒 Files selected for processing (1)
  • newton/examples/ik/example_ik_custom.py

📝 Walkthrough

Walkthrough

Updated collision avoidance configuration parameters in the IK custom example: reduced the softplus margin from 0.15 to 0.12, increased collision detection sphere radii for two links, and lowered the collision objective weight from 50.0 to 3.0.

Changes

Cohort / File(s) Summary
Collision Avoidance Parameters
newton/examples/ik/example_ik_custom.py
Adjusted softplus penetration-penalty margin from 0.15 to 0.12, increased collision sphere radii for fr3_hand_tcp and fr3_link3, and reduced collision objective weight from 50.0 to 3.0.

Estimated Code Review Effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly Related PRs

  • Fix issues in ik custom example #1947: Modifies the same example file with related collision handling parameter adjustments (softplus margin, collision-sphere radii, and collision-objective weight).

Suggested Reviewers

  • eric-heiden
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: tuning avoidance objective parameters in the example IK custom code.
Linked Issues check ✅ Passed The PR directly addresses issue #2364 by reducing the collision-avoidance margin through parameter adjustments to sphere radii, softplus margin, and objective weight.
Out of Scope Changes check ✅ Passed All changes are scoped to tuning example parameters in a single file to address the reported collision-avoidance margin issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@camevor camevor marked this pull request as ready for review April 8, 2026 13:56
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Member

@adenzler-nvidia adenzler-nvidia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — clean, focused parameter tune that directly addresses #2364. The combination of larger collision spheres with reduced weight and margin is a sensible approach, and the video confirms improved behavior. Consider adding a brief CHANGELOG entry under Changed if this ships in a tagged release.

@adenzler-nvidia adenzler-nvidia added this pull request to the merge queue Apr 9, 2026
Merged via the queue into newton-physics:main with commit 8c98067 Apr 9, 2026
25 checks passed
adenzler-nvidia pushed a commit to adenzler-nvidia/newton that referenced this pull request Apr 9, 2026
jsw7460 pushed a commit to jsw7460/newton that referenced this pull request Apr 13, 2026
@camevor camevor deleted the ik-avoid-weight branch April 21, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[BUG] ik_custom example has a large margin for collision avoidance

2 participants