gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
621 stars 251 forks source link

Add support for no gravity link #2398

Closed AzulRadio closed 3 weeks ago

AzulRadio commented 1 month ago

🎉 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

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.

arjo129 commented 1 month ago

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

AzulRadio commented 1 month ago

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.

iche033 commented 4 weeks ago

@osrf-jenkins run tests please

iche033 commented 3 weeks ago

made some minor changes in 72b8f3c - simplified gravity component data check, and updated style and indentation.

iche033 commented 3 weeks ago

@ahcorde friendly ping to see if you're ok with the new changes and also merging this PR?