Skip to content

Closed kinematic chain#987

Open
yaswanth1701 wants to merge 9 commits into
gazebosim:mainfrom
yaswanth1701:closed-kinematic_chain
Open

Closed kinematic chain#987
yaswanth1701 wants to merge 9 commits into
gazebosim:mainfrom
yaswanth1701:closed-kinematic_chain

Conversation

@yaswanth1701

Copy link
Copy Markdown
Contributor

🎉 New feature

Closes #25

Summary

This feature supports closed kinematic chains for dartsim.

Test it

  • Load any of following models present in gz-physics/test/common_test/worlds/
    • anchored_loop.sdf
    • closed_loop_four_bar_linkage.sdf
    • free_loop.sdf

Video

Closed kinematic loop in dartsim (frequency of oscillation: 0.77) Mimic constrain in bullet-featherstone (frequency of oscillation: 0.83)
Screencast.from.05-22-2026.01.03.48.AM.webm
Screencast.from.05-22-2026.01.03.06.AM.webm

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the feature
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Comment thread CMakeLists.txt
#============================================================================
# Find gz-cmake
#============================================================================
find_package(gz-cmake REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these look like changes from jetty (gz-physics9). can you rebase the relevant commits onto main?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

here is a comparison of an earlier state of your branch against gz-physics9 before it was merged with main:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if you could rebranch from there and then add any missing commits, then you could try squashing it all and rebasing onto main?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the trouble. The issue is resolved now.

@yaswanth1701 yaswanth1701 force-pushed the closed-kinematic_chain branch 2 times, most recently from 0827b85 to 4ee9c1d Compare May 21, 2026 22:05

@ntfshard ntfshard left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Some general comments

@@ -0,0 +1,393 @@
<?xml version="1.0" ?>
<sdf version="1.11">e

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just curious, how it should work with this e symbol? Same in other file in this PR

<!-- upper left link, length 0.5 -->
<link name="upper_left_link">
<pose degrees="true" relative_to="base_top_left_mount">0.15 0 0 -155 0 0</pose>
<self_collide>0</self_collide>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

by-default it's already false https://sdformat.org/spec/1.11/link/#link_self_collide

And I guess it's one of parts of system which can breaks. Maybe if we have different amount of links (1 and 2 to common child)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, I didn't know that. I will remove it from here, and yeah, the system will break with collision turned on.

<physics type="dart">
<dart>
<solver>
<solver_type>pgs</solver_type>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if it's important option, maybe add warning if closed chain detected and solver is different

@yaswanth1701 yaswanth1701 Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure I will add a warning here!!

Comment thread test/common_test/joint_features.cc Outdated
Comment on lines +2919 to +2921
// mimic joint oscillation frequency is 0.84
// closed kinematic chain frequency is 0.756
ASSERT_NEAR(frequency, 0.8, 0.1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

maybe split to 2 different tests? you have dispatch in the beginning, and here very coarse check.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can you explain this a bit more?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I suggest to have single responsibility for each test. In the begging you have dispatcher by physics engine and here you have check for swing frequency.

It's even a different implementations: one for fair joints, one for mimic

@yaswanth1701 yaswanth1701 Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#25 (comment)

I was writing this test case, keeping this as a reference. So thought this would be good to do since it's not possible to load both physics engines in a single test case. Tho there might be a better way of doing this.

</link>

<!-- pin joint for upper left link, at origin of upper left link -->
<joint name="upper_left_joint" type="revolute">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

all joints in this tests are revolute.
maybe worth to check other types in a same closed kinematics chain context

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, will try to add a test with other type of joints.

yaswanth1701 and others added 9 commits June 6, 2026 15:46
Signed-off-by: yaswanth1701 <gonnayaswanth17@gmail.com>
Signed-off-by: yaswanth1701 <gonnayaswanth17@gmail.com>
Signed-off-by: yaswanth1701 <gonnayaswanth17@gmail.com>
Signed-off-by: yaswanth1701 <gonnayaswanth17@gmail.com>
Signed-off-by: yaswanth1701 <gonnayaswanth17@gmail.com>
Signed-off-by: yaswanth1701 <gonnayaswanth17@gmail.com>
Signed-off-by: yaswanth1701 <gonnayaswanth17@gmail.com>
Signed-off-by: yaswanth1701 <gonnayaswanth17@gmail.com>
Co-authored-by: Maksim Derbasov <ntfs.hard@gmail.com>
Signed-off-by: Yaswanth <92177410+yaswanth1701@users.noreply.github.com>
@yaswanth1701 yaswanth1701 force-pushed the closed-kinematic_chain branch from bd88b6b to 9b904c9 Compare June 6, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

Support of closed kinematic chains

4 participants