gazebosim / gz-physics

Abstract physics interface designed to support simulation and rapid development of robot applications.
https://gazebosim.org
Apache License 2.0
62 stars 38 forks source link

bullet-featherstone: Add Kinematic feature #618

Open iche033 opened 3 months ago

iche033 commented 3 months ago

πŸŽ‰ New feature

Summary

Note: bullet version >=3.07 is need for this feature. On Jammy, the version is 3.06 so you'll need to build bullet from source. Noble should come with 3.24

Initial support for kinematic mode in bullet-featherstone implementation.

Not supported yet - setting velocity to a kinematic link or to a joint connecting kinematic links.

Test it

Added tests to make sure we can make base and non-base links kinematic.

You can also test with gz-sim. Example: the base and upper_link links are set to kinematic in the pendulum_links.sdf.

patch ```diff diff --git a/examples/worlds/pendulum_links.sdf b/examples/worlds/pendulum_links.sdf index 5eecd1893..bd5ec53d5 100644 --- a/examples/worlds/pendulum_links.sdf +++ b/examples/worlds/pendulum_links.sdf @@ -71,6 +71,7 @@ + true -0.188749 0 0.75813399999999997 -0.13567899999999999 0 1.5708 256.42500000000001 @@ -130,6 +131,7 @@ + true 0 0 2.1 -1.5708 0 0 0 ```

Launch the world with bullet-featherstone plugin:

gz sim -v 4 <path_to_pendulum_links.sdf> --physics-engine gz-physics-bullet-featherstone-plugin

bullet_kinematic_pendulum

Checklist

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 78.36%. Comparing base (492b124) to head (d175730). Report is 16 commits behind head on main.

:exclamation: Current head d175730 differs from pull request most recent head 894645d. Consider uploading reports for the commit 894645d to get more accurate results

Files Patch % Lines
include/gz/physics/detail/Kinematic.hh 0.00% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #618 +/- ## ========================================== + Coverage 78.32% 78.36% +0.04% ========================================== Files 140 141 +1 Lines 8069 8136 +67 ========================================== + Hits 6320 6376 +56 - Misses 1749 1760 +11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

scpeters commented 3 weeks ago

I think we need more documentation on what it means for a Link to be Kinematic, including the documenation for the SDFormat //link/kinematic tag:

I'm currently looking at the documentation for ODE and bullet for inspiration:

scpeters commented 3 weeks ago

I think we need more documentation on what it means for a Link to be Kinematic, including the documenation for the SDFormat //link/kinematic tag:

I'm currently looking at the documentation for ODE and bullet for inspiration:

also for dart: https://github.com/dartsim/dart/blob/main/dart/dynamics/Joint.hpp#L178-L187