Fix FreeJoint world Jacobian translation
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 forQ, 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; fixupdateRelativeJacobianTimeDeriv()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-allto lint, build, and test your changes (CI passed; locally ranpixi 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
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: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@codex review
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
@codex review
@codex review
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".