Skip to content

Keep axis-angle conversion gradients finite at identity - #9251

Open
sylvesterkaczmarek wants to merge 3 commits into
isaac-sim:mainfrom
sylvesterkaczmarek:fix/axis-angle-identity-gradients
Open

sylvesterkaczmarek wants to merge 3 commits into
isaac-sim:mainfrom
sylvesterkaczmarek:fix/axis-angle-identity-gradients

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Use a safe denominator for the inactive exact-ratio branch of quaternion-to-axis-angle conversion. Preserve the existing forward calculation and Taylor approximation, while preventing NaN gradients at identity rotations.

Fixes #9250.

Type of change

  • Bug fix

Validation

  • The new identity-gradient regression failed on main and passed after the fix.
  • Full math test file: 123 passed, 3 skipped on CPU.
  • Changelog and diff checks passed.
  • Full formatting, GPU and simulator integration checks were not run.

Checklist

  • Read contribution guidelines.
  • Added regression coverage and a changelog fragment.
  • Added contributor name.
  • Full formatting and integration checks.

Current-head validation: 123 CPU math tests passed, 3 CUDA-only tests skipped; scoped Ruff lint and formatting pass. The final follow-up is formatting-only. Full simulator/GPU integration remains pending.

Fixes isaac-sim#9250.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
@sylvesterkaczmarek
sylvesterkaczmarek requested a review from a team November 26, 2026 00:21
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Nov 26, 2026
@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

axis_angle_from_quat now uses a safe denominator in the unused exact-ratio branch to prevent NaN gradients at identity.

  • Axis-angle conversion keeps identity gradients finite.

Reviews (1) · Last reviewed commit: "Keep axis-angle conversion gradients fin..." · Reviewed by Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isaac Lab Review Bot

Needs attention: Style consistency (1), Test quality (1). Other reviewed categories look good.

  • PR description: The title and body match the denominator guard, regression, changelog, and contributor entry; reported CPU validation and omitted checks are explicit, with no measurable performance claim requiring benchmarks.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: No over-engineering issues.
  • API: API changes look good.
  • Compatibility and deprecation: No breaking changes identified.
  • Implementation: Implementation looks good.
  • Style consistency: ones_like(angle) creates an unnecessary batch-sized fallback allocation; use scalar 1.0 in torch.where instead.
  • Test quality: The distinct identity-gradient regression lacks the required kitless marker, excluding its file from marker-text selection; add pytest.mark.kitless to the test.

Minor fixes needed. Posted 2 inline findings.

Automated review; human maintainers own approval decisions.

Comment thread source/isaaclab/isaaclab/utils/math.py Resolved
Comment thread source/isaaclab/test/utils/test_math.py Resolved
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Used a scalar 1.0 fallback in torch.where and marked the identity-gradient regression kitless in 76e3a20. The existing forward and Taylor branches are unchanged. Python syntax and diff checks passed; runtime tests were not rerun locally.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] axis_angle_from_quat produces NaN gradients at identity rotations

1 participant