dart icon indicating copy to clipboard operation
dart copied to clipboard

Fix FreeJoint world Jacobian translation

Open jslee02 opened this issue 1 week ago • 3 comments

Fixes #1657.

This updates dynamics::FreeJoint Jacobian/integration logic to remain consistent when T_parentBodyToJoint and T_childBodyToJoint are non-identity.

  • Fix FreeJoint::integratePositions() to integrate the relative transform (body twist) and solve back for Q, preserving correct motion with offset joint frames.
  • Fix FreeJoint::getRelativeJacobianStatic(positions) to use the passed positions (instead of a cached Jacobian).
  • Ensure setRelativeSpatialVelocity() uses the up-to-date pose-dependent Jacobian; fix updateRelativeJacobianTimeDeriv() for non-identity child joint frames.
  • Add C++ integration coverage: FD world Jacobian + classic-deriv checks (including near-π), pose-change setter regression, and energy conservation checks.
  • Add GUI example free_joint_cases (ImGui) to visualize linear-only/angular-only/both and edge cases, with built-in numeric checks.

Before creating a pull request

  • [ ] Run pixi run test-all to lint, build, and test your changes (CI passed; locally ran pixi run lint, pixi run test, pixi run test-py)
  • [x] Add unit tests for new functionality
  • [ ] Document new methods and classes
  • [ ] Add Python bindings (dartpy) if applicable

jslee02 avatar Dec 12 '25 20:12 jslee02

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 62.93%. Comparing base (52f71d7) to head (59a9642). :warning: Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2298      +/-   ##
==========================================
+ Coverage   62.89%   62.93%   +0.03%     
==========================================
  Files         363      363              
  Lines       33023    33044      +21     
  Branches     4349     4347       -2     
==========================================
+ Hits        20769    20795      +26     
+ Misses      12254    12249       -5     
Flag Coverage Δ
unittests 62.93% <100.00%> (+0.03%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
dart/dynamics/FreeJoint.cpp 80.00% <100.00%> (+0.43%) :arrow_up:

... and 3 files with indirect coverage changes

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Dec 12 '25 20:12 codecov[bot]

@codex review

jslee02 avatar Dec 13 '25 01:12 jslee02

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codex review

jslee02 avatar Dec 16 '25 00:12 jslee02

@codex review

jslee02 avatar Dec 16 '25 09:12 jslee02

@codex review

jslee02 avatar Dec 16 '25 16:12 jslee02

Codex Review: Didn't find any major issues. Can't wait for the next one!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".