ami-iit / jaxsim

A differentiable physics engine and multibody dynamics library for control and robot learning.
https://jaxsim.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
69 stars 10 forks source link

Add mesh support #156

Open lorycontixd opened 4 months ago

lorycontixd commented 4 months ago

This pull requests aims to extend Jaxsim's parsing functionalities on robot descriptions to meshes. It does so by using third-party library trimesh to parse the mesh file, and custom algorithm create_mesh_collisions to wrap a mesh with collidable points.


📚 Documentation preview 📚: https://jaxsim--156.org.readthedocs.build//156/

flferretti commented 4 months ago

@lorycontixd do you prefer a squash and merge or can you please clean the commit history?

diegoferigo commented 4 months ago

For the records, this is the function called to load a mesh in trimesh:

https://trimesh.org/trimesh.html#trimesh.load

flferretti commented 4 months ago

@diegoferigo before merging this, do we want to set meshes support as default or should it be activated using an environment variable?

diegoferigo commented 4 months ago

@diegoferigo before merging this, do we want to set meshes support as default or should it be activated using an environment variable?

Yes I need to properly assess the implications of merging this PR on existing appplications. Automatically adding the collidable points of all meshes is a huge change of behavior and it will make existing simulations unbearably slow.

lorycontixd commented 4 months ago

@diegoferigo @flferretti As of now, random point sampling from a mesh is supported. I think it would be a good idea if I tried to benchmark different values of sampling points and find a good tradeoff between performance and simulation results.

diegoferigo commented 3 months ago

Reminder to myself: bump the version of the ROD dependency before merging this PR.

flferretti commented 2 months ago

@lorycontixd if you see commits pushed by a bot, don't worry. We can squash those. This should stop as soon as #197 gets merged

lorycontixd commented 2 months ago

I was wondering 😂 Thanks for letting me know!

lorycontixd commented 2 months ago

Must find a way to inject the wrapping method from outside the api (create_mesh_collision func.) for each mesh, if needed.