Skip to content

Conversation

@jslee02
Copy link
Member

@jslee02 jslee02 commented Nov 23, 2025

Summary

  • Reproduce the Gazebo mimic regression (Support mimic constraint (dartsim) gazebosim/gz-physics#432) via the same mimic pendulums SDF/example and align DART’s mimic/coupler constraints accordingly
  • Restore mimic motor ERP/CFM defaults via constexpr constants and keep coupler/mimic configs consistent; expose PlanarJoint converter declarations to match definitions
  • Make mimic example/tests tolerate optional Bullet/ODE backends (Bullet guarded) while keeping unilateral MimicMotorConstraint usage

Testing

  • pixi run test-all
  • pixi run ex mimic_pendulums
Screencast.from.2025-11-23.11-02-56.mp4
  • Blue pendulum (fast rod) mimics the long rod of the middle pendulum.
  • Red pendulum (slow rod) mimics the short rod of the middle pendulum.

Before creating a pull request

  • Run pixi run test-all to lint, build, and test your changes
  • Add unit tests for new functionality (not needed; covered by existing mimic/planar tests)
  • Document new methods and classes
  • Add Python bindings (dartpy) if applicable

…ead of local followers

- Updated configureMimicMotors in both example and test to get reference joints from middle pendulum (pendulum_with_base) instead of same skeleton
- Modified MimicPairView to track middleReference from the middle pendulum
- Updated GUI renderMimicTable to show error against middle pendulum reference
- Made GUI widget resizable with initial size 800x600
- Added ImGuiTableFlags_Resizable for resizable table columns
- Per-step mimic tracking ensured via MimicMotorConstraint's ERP/CFM parameters

This fixes gazebosim/gz-physics#432 issue where followers now properly track the correct reference joints over extended simulations.
# Conflicts:
#	dart/constraint/CouplerConstraint.hpp
#	dart/constraint/MimicMotorConstraint.hpp
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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".

@jslee02 jslee02 changed the title Support mimic constraints cleanup Improve mimic/coupler constraints for gz-physics mimic repro Nov 23, 2025
@jslee02 jslee02 changed the title Improve mimic/coupler constraints for gz-physics mimic repro Fix mimic/coupler constraints to mirror Gazebo mimic repro Nov 23, 2025
@jslee02
Copy link
Member Author

jslee02 commented Nov 23, 2025

@codex review

@jslee02 jslee02 added this to the DART 7.0 milestone Nov 23, 2025
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ 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".

Copy link
Collaborator

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

testing in progress

@jslee02 jslee02 force-pushed the gz/mimic_constraint branch from f0389cc to 15b47b3 Compare November 24, 2025 00:15
@jslee02
Copy link
Member Author

jslee02 commented Nov 24, 2025

testing in progress

Thank you for the comments! Fixed the build errors and cleaned up the .sdf file as well

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 69.76744% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.83%. Comparing base (5237903) to head (016af54).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
dart/constraint/MimicMotorConstraint.cpp 59.25% 11 Missing ⚠️
dart/constraint/CouplerConstraint.cpp 87.50% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2247   +/-   ##
=======================================
  Coverage   60.82%   60.83%           
=======================================
  Files         353      353           
  Lines       31880    31911   +31     
  Branches     4128     4139   +11     
=======================================
+ Hits        19392    19412   +20     
- Misses      12488    12499   +11     
Flag Coverage Δ
unittests 60.83% <69.76%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
dart/constraint/CouplerConstraint.cpp 77.29% <87.50%> (+0.72%) ⬆️
dart/constraint/MimicMotorConstraint.cpp 77.24% <59.25%> (-4.22%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

yes, this is more stable, but I still see energy increasing enough that the pendulum swings cause displacement of the bases

here is a 10x screen recording. the pendulums start parallel to the ground (initial angle 90 degrees from vertical) with no kinetic energy, and this is a passive system, so none of the pendulums should swing above the horizontal, but I see both pendulums swing above horizontal at some points, though the slow_follows_fast model on the left has the most dramatic energy gain

dartsim.mimic.pendulums.energy.gain.Screen.Recording.2025-11-23.at.8.23.48.PM.mp4

I think this is fine to merge; it is better, though not yet best as there's still room for improvement in the numerical stability when using the coupler constraint

@jslee02
Copy link
Member Author

jslee02 commented Nov 24, 2025

Thanks for running the long test! I hadn’t exercised it that far yet, so I didn’t see this. I’ll dig in and address it in a follow-up.

@jslee02 jslee02 merged commit 94a5d5b into main Nov 24, 2025
6 of 30 checks passed
@jslee02 jslee02 deleted the gz/mimic_constraint branch November 24, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants