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

Alternative physics engine: Nvidia PhysX #153

Open diegoferigo opened 3 years ago

diegoferigo commented 3 years ago

With this issue I want to collect some resources and assess whether there's any interest from the community to provide support to Nvidia Physx.

Historically, Gazebo Classic supported ODE, bullet, DART, and simbody. In these past weeks, I noticed some new movement in the custom branches for implementing bullet, and this is great. For what concerns ODE and simbody, there's already a ticket open https://github.com/ignitionrobotics/ign-physics/issues/63.

Nvidia Physx has been open-sourced "recently". It is Nvidia's choice for their Isaac Sim simulator and I expect a bright future for this engine. One of the notable features is the possibility to simulate physics on GPUs, allowing to scale a simulation to hundred or thousands of models.

I'd be super excited to see anything similar running in Gazebo. I've just found rumors about a new major release https://github.com/NVIDIAGameWorks/PhysX/issues/309#issuecomment-665751081.

mabelzhang commented 3 years ago

That would be exciting. Just wearing my personal hat, not representing any organization (where's my GitHub account number 2). PhysX's deformable object demo is really cool. I've seen limited robotics applications using it. Do you have a short list of robotics applications you've seen (that isn't NVIDIA's own promo)? I'm wondering about the physics fidelity. Isaac was something I kept an look out for a few years ago.

traversaro commented 3 years ago

I've just found rumors about a new major release NVIDIAGameWorks/PhysX#309 (comment).

FYI there has been a follow up on this: https://github.com/NVIDIAGameWorks/PhysX/issues/371#issuecomment-756794998 . TL;DR: Unfortunately the focus of the PhysX team switched from the open source C++ SDK for integration with other tools to the use of PhysX in Nvidia Omniverse so while they are working on it, it is not a priority and they don't have a release scheduled yet.

diegoferigo commented 3 years ago

I missed that follow up, good catch @traversaro. It's a shame the SDK got delayed. As commented in the original issue, not much system integration seems possible from Omniverse.

@mabelzhang not really, I was impressed as well from their results, but then I couldn't find many third-party projects using PhysX. Here below few links I found in my starred projects:

A while ago I tried to have a look to PhysX, but I found it difficult to import the SDK in an external project, see https://github.com/NVIDIAGameWorks/PhysX/issues/208 and https://github.com/NVIDIAGameWorks/PhysX/issues/249. There is an external contribution that didn't get much interests from upstream https://github.com/NVIDIAGameWorks/PhysX/pull/222.

Up to today, I think that vcpkg/ports/physx is a reasonable solution to install PhysX if anyone wants to have a look. As reported in https://github.com/microsoft/vcpkg/pull/13849, there no GPU support yet, but it can be a good starting point.

uahic commented 3 years ago

There is interest from my side and the research institute (FZI) I am working for, too. We are currently working (mostly) with the good old Gazebo (minus ignition). Switching to Nvidia Isaac Sim just because of PhysX is not really what we want at this point.

Although I found it pretty nice to work with its at a very early development stage and a framework approach is most often less flexible. So pushing forward Ignition along with PhysX is definitly something we would appreciate and I could offer help to participate in the integration beside my regular work schedule :)

This being said, I would need some pointers where and how to start off and who is already working on it (if any)

mabelzhang commented 3 years ago

On the PhysX side, it sounds like the starting point is the vcpkg link above. I haven't tried to install it. On the Ignition side, there's a recent effort to integrate the Bullet engine, which might give some good pointers to what's needed to hook things up https://github.com/ignitionrobotics/ign-physics/pull/208 The ign-physics tutorials have usage examples that might be useful too https://ignitionrobotics.org/api/physics/2.3/tutorials.html

rishikeshrmadan commented 3 years ago

I too would like to contribute in some manner, is anyone working on this at present? In the opinion of you all, will 5.0 be easy to port to once it releases? and since the 5.0 release timeline is uncertain, if one has to work on this, going forward with 4.1 integration in the meanwhile seems to be a sound choice right?

chapulina commented 3 years ago

is anyone working on this at present?

Open Robotics currently has no plans to work on this, but we welcome pull requests. The plugin could also be implemented in a separate repository and does not need to be included into this one.

will 5.0 be easy to port to once it releases? and since the 5.0 release timeline is uncertain, if one has to work on this, going forward with 4.1 integration in the meanwhile seems to be a sound choice right?

I assume you mean Ignition Physics 5.0? We just released 4.0 with Ignition Edifice. At the moment, we can't say for sure whether 5.0 will be included into Ignition Fortress, coming up September 2021, or if that's going to use 4.x. Whether we bump the version or not will depend on whether breaking changes are needed until then, and we usually make this decision in the middle of the development cycle.

In any case, adding support to a new physics engine should be possible against any existing stable release. I would suggest you target Ignition Physics 2.X, which is the version used in the current LTS, Citadel.

mabelzhang commented 3 years ago

Might be talking about NVIDIA PhysX 5.0, which was supposed to be released in 2020 but still isn't :sweat_smile: https://github.com/NVIDIAGameWorks/PhysX/issues/309#issuecomment-665751081