dartsim: Add support for the <kinematic> tag#758
dartsim: Add support for the <kinematic> tag#758jcmayoral wants to merge 44 commits intogazebosim:mainfrom
<kinematic> tag#758Conversation
|
Same as #756 A comparison between kinematic and non-kinematic collision with static box kinematic-tag-demo-2025-07-09_19.08.49.mp4 |
311f5f1 to
a39f1d0
Compare
|
See #756 (comment) |
|
@jcmayoral can you update the PR description? |
<kinematic> tag
|
cc @iche033 |
|
@azeey Is there a feature list of a issue list I can refer to? So I can complete the description? |
|
Checking the test I found that the Bazel CI was failing because of this line: [3,384 / 3,394] 48 / 57 tests, 1 failed; Compiling dartsim/src/KinematicsFeatures.hh; 7s processwrapper-sandbox ... (4 actions running) But I did not modify that file. Is it part of the pipeline? |
If there's no issue, you can skip that, but please add more description on what this PR does, and the approach you are taking. Also remove the parts of the template that are not relevant (i.e, bug fix and release sections). You can look at other PRs in this repo for reference. |
|
@azeey I just updated it. Please, let me know if something is missing. |
|
@jcmayoral After looking at the discussion in the upstream DART PR, I tested out what setting the joint actuator type to ACCELERATION would do and I think it does make the link "kinematic". For the quickest test, I added to gz-physics/dartsim/src/SDFFeatures.cc Lines 725 to 726 in d604919 right after Screen.Recording.2025-08-20.at.00.58.24.mp4Can you give it a try? Maybe all we need need to do is detect if a link is kinematic and set the actuator type of it's parent joint to ACCELERATION. cc @iche033 |
|
This would be a great addition to Gazebo, but it's a large change and we're not sure about the approach taken. With |
|
@azeey it's unfortunate that this will miss the code freeze. We originally needed the kinematic tag and had been commenting and working on top of this MR: #618 from @iche033 which adds kinematic tag for bullet but as we moved further along with our migration we realized we had behaviors which require us to use Dartsim. What are the possibilities or options to have something like this back-ported to jetty? |
It's should be possible to backport since the changes shouldn't break API/ABI. We might even be able to backport it to Ionic/Harmonic. |
|
Great, Thanks. We've been testing Harmonic / Ionic via source builds but if this had made it into Jetty it would have clearly given us a reason to target Jetty ASAP... Need to get over the migration we still have performance related issues where Gazebo Classic out performs Gazebo in most cases unless you have GPUs, but this |
Signed-off-by: Jose Mayoral <jocamaba1989@gmail.com> Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jocamaba1989@gmail.com> Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jocamaba1989@gmail.com> Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jocamaba1989@gmail.com> Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
96a8c91 to
fd18910
Compare
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
… into ionic-kinematic-tag
Signed-off-by: Jose Mayoral <jcmbanos@ottomotors.com>
| bodyProperties.mInertia.setMass(sdfInertia.MassMatrix().Mass()); | ||
| bodyProperties.mGravityMode = _sdfLink.EnableGravity(); | ||
| bodyProperties.mInertia.setMoment(I_link); | ||
|
|
||
| bodyProperties.mInertia.setLocalCOM(localCom); | ||
| bodyProperties.mFrictionCoeff = 0; |
There was a problem hiding this comment.
Are any of these lines necessary? These properties are already being set above or elsewhere.
| bodyProperties.mInertia.setLocalCOM(localCom); | ||
| bodyProperties.mFrictionCoeff = 0; | ||
|
|
||
| if(isKinematic){ |
There was a problem hiding this comment.
nit: Style
| if(isKinematic){ | |
| if(isKinematic) | |
| { |
|
|
||
| if(isKinematic){ | ||
| gzdbg << "Kinematic tag found -> " << bodyProperties.mName << std::endl; | ||
| jointProperties.mName = bodyProperties.mName + "_KinematicJoint"; |
There was a problem hiding this comment.
Is there a reason for changing the name of the joint?
| gz::math::eigen3::convert(frameData.linearVelocity)); | ||
| EXPECT_EQ(gz::math::Vector3d::Zero, | ||
| gz::math::eigen3::convert(frameData.angularVelocity)); | ||
|
|
There was a problem hiding this comment.
Can you also check that setting the velocity of the link works?
| // currently only dartsim is supported | ||
| if (this->PhysicsEngineName(name) != "dartsim") | ||
| continue; |
There was a problem hiding this comment.
Bullet-featherstone also supports kinematic links (see #618).
🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸🔸
🎉 New feature
Bring back the kinematic tag available in gazebo classic.
Summary
Adding the kinematic tag feature for dartsim physics engine. The dart joints used in gz-physics are called FreeJoints, available in dart upsteam repository in this file FreeJoint.cpp . However, as it can be observed, this joint is designed to integrate accelerations over time to calculate speed, and integrate speed to get positions. Therefore, other type of joint is needed to achieve the behavior of the Kinematic tag which ignores Forces.
In this MR for dart, an attempt to integrate this joint to the upstream repository can be found, but it seems the use case is really gazebo-related, also it will require to bump the dart version used on gz-physics. Therefore, those changes are integrated to this one MR, adding the KinematicJoint as a customization of dart (based on the feedback given on the dart MR (KinematicJoint.cc and KinematicJoint.hh).
Test it
In order to test, the MR can be compiled and using the following sdf (attached as a txt file):
kinematic-robot.sdf.txt
Once compiled, rename the file to kinematic-robot.sdf, and run
gz sim -v 4 kinematic-robot.sdf
A comparison between setting the kinematic tag (true/false) can be seen in the next video.
kinematic-tag-demo-2025-07-09_19.08.49.mp4
Checklis
codecheckpassed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-byandGenerated-bymessages.