Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for no gravity link #2398

Open
wants to merge 2 commits into
base: ign-gazebo6
Choose a base branch
from

Conversation

AzulRadio
Copy link
Contributor

@AzulRadio AzulRadio commented May 8, 2024

🎉 New feature

Original issue: #504

A feature I find very useful when I use Gazebo Classic but surprisingly unavailable in Ignition.

I'm targeting Gazebo Fortress because I need this feature for my projects on Fortress. Might need some back/forward porting.

Changes in other repo:
gz-physics: gazebosim/gz-physics#633
sdformat: gazebosim/sdformat#1410

Summary

Add parsing and support for no gravity link when using DartSim engine

Implementation for other physics engines should be easy if they have link no gravity API.

Test it

Spawn the following entity to gazebo.

<?xml version="1.0" ?>
    <sdf version='1.7'>
      <model name='sphere'>
        <link name='link'>
          <gravity>false</gravity>
          <pose>0 0 0.5 0 0 0</pose>
          <visual name='visual'>
            <geometry><sphere><radius>1</radius></sphere></geometry>
          </visual>
          <collision name='collision'>
            <geometry><sphere><radius>1</radius></sphere></geometry>
          </collision>
        </link>
      </model>
</sdf>

The way I do this is to add <gravity>false</gravity> to gz-sim/examples/standalone/entity_creation's inline sdf and run the example.

The black sphere has link gravity disabled and the cube is spawned with GUI and has gravity by default.
no grav link

Checklist

  • Signed all commits for DCO
  • 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)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label May 8, 2024
@AzulRadio AzulRadio marked this pull request as ready for review May 8, 2024 05:12
@arjo129
Copy link
Contributor

arjo129 commented May 8, 2024

Can you signoff your commits following the instructions here: https://github.com/gazebosim/gz-sim/pull/2398/checks?check_run_id=24713135239

On a side note if you need to achieve the same effect immediately: I achieve similar results using the <static> tag

@arjo129 arjo129 added the needs upstream release Blocked by a release of an upstream library label May 8, 2024
src/SdfEntityCreator.cc Outdated Show resolved Hide resolved
src/systems/physics/Physics.cc Outdated Show resolved Hide resolved
src/systems/physics/Physics.cc Outdated Show resolved Hide resolved
src/systems/physics/Physics.cc Outdated Show resolved Hide resolved
Signed-off-by: youhy <haoyuan2019@outlook.com>
Signed-off-by: youhy <haoyuan2019@outlook.com>
@AzulRadio
Copy link
Contributor Author

Can you signoff your commits following the instructions here: https://github.com/gazebosim/gz-sim/pull/2398/checks?check_run_id=24713135239

I signed off with a new GPG key and added the key to Gtihub after I made the PR. So apparently DCO doesn't like that. Now it's fixed.

On a side note if you need to achieve the same effect immediately: I achieve similar results using the <static> tag

Thanks. I'll try that.

@AzulRadio AzulRadio requested a review from ahcorde May 9, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress needs upstream release Blocked by a release of an upstream library
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

None yet

3 participants