robotology / gym-ignition

Framework for developing OpenAI Gym robotics environments simulated with Ignition Gazebo
https://robotology.github.io/gym-ignition
GNU Lesser General Public License v3.0
227 stars 26 forks source link

Add support to bullet physics engine #340

Open diegoferigo opened 3 years ago

diegoferigo commented 3 years ago

Related to the upcoming bullet support, more info in April's 2021 Community Meeting.

This PR is very WIP because the new bullet plugin has not yet been released nor finalized. However, a while ago I wanted to play with it :smiley:

It needs a custom branch of ign-physics that is not currently enabled in CI.

TODO:

diegoferigo commented 3 years ago

The new release https://github.com/ignitionrobotics/ign-physics/pull/255 contains the bullet physics backend, maybe now this PR could be finalized. Checking if CI succeeds.

diegoferigo commented 3 years ago

Tests are failing with the following:

[Wrn] [Physics.cc:592] Plugin [ignition::physics::bullet::Plugin] misses required features:
- N8ignition7physics26RemoveNestedModelFromModelE
[Err] [Physics.cc:597] Failed to load a valid physics engine from [/workspace/install/lib/ign-physics-4/engine-plugins/libignition-physics-bullet-plugin.so].

I guess I have to align the Physics system with upstream. When I first opened this PR, the test was passing.

diegoferigo commented 3 years ago

This PR depends on https://github.com/ignitionrobotics/ign-gazebo/pull/690 that is part of Ignition Edifice 5.1. However, as tracked in #319, that PR causes a significant performance drop when contacts are involved (e.g. in the panda manipulation example).

This means that our vendored physics system has to revert that PR for the moment, and bullet support has to be postponed until the origin of the slow-down is found.

diegoferigo commented 3 years ago

I opened https://github.com/ignitionrobotics/ign-physics/issues/273 to track the problem occurring in the tests.

diegoferigo commented 3 years ago

The bullet engine does work with simple simulations like those included in the test (at least locally in a conda-based environment that has a recent bullet version). However, more complex simulations like the manipulation example do not work properly, the panda get smashed in the beginning (maybe due to the PIDs?). Furthermore, this PR updates the Physics system with a feature that has been reverted from upstream that causes a performance regression when contacts are involved (#319).