Skip to content

translate URDF <mimic> joints to joint equality constraints - #3530

Open
Abhayindia wants to merge 3 commits into
google-deepmind:mainfrom
Abhayindia:warn-urdf-mimic
Open

translate URDF <mimic> joints to joint equality constraints#3530
Abhayindia wants to merge 3 commits into
google-deepmind:mainfrom
Abhayindia:warn-urdf-mimic

Conversation

@Abhayindia

@Abhayindia Abhayindia commented Aug 28, 2026

Copy link
Copy Markdown

per #3527. urdf <mimic multiplier="M" offset="O"> on a follower joint becomes an <equality><joint> with polycoef = [O M 0 0 0]. couplings are collected during joint parsing and emitted after, so the target joint can be declared later in the file.

also wired xml_urdf_test.cc into cmake - it wasn't referenced by any target so its tests weren't building.

@google-cla

google-cla Bot commented Aug 28, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Abhayindia Abhayindia changed the title warn when a URDF joint's <mimic> element is dropped translate URDF <mimic> joints to joint equality constraints Aug 28, 2026
@Abhayindia

Copy link
Copy Markdown
Author

added the guard - a mimic pointing at a fixed/planar/floating/missing joint now warns and is skipped rather than failing the load, with a test for the fixed-target case. thanks for catching that.

@sylvesterkaczmarek sylvesterkaczmarek 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.

Could we make the mimic regression behavioral rather than only checking the emitted IDs and polycoef? The current test would still pass if the equality were wired in the wrong direction or interpreted incorrectly relative to the joint references. A small case with a nonzero driver value, multiplier=-1, and nonzero offset that checks the resulting equality residual/tracking would pin the actual URDF q_follower = M*q_driver + O semantics.

@Abhayindia

Copy link
Copy Markdown
Author

done - MimicBecomesJointEquality now simulates from a driver displacement (multiplier=-1, offset=0.02, damping so it settles) and checks q_right == -q_left + 0.02 to 1e-4, so it'd catch a wrong direction or a dropped multiplier/offset.

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.

2 participants