ami-iit / adam

adam implements a collection of algorithms for calculating rigid-body dynamics in Jax, CasADi, PyTorch, and Numpy.
https://adam-docs.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
123 stars 19 forks source link

Handle the case in which a parametric link is not a box, cylinder or sphere #68

Closed S-Dafarra closed 5 months ago

S-Dafarra commented 6 months ago

When specifying a link as a parametric, only the box, sphere, and cylinder cases seem to be supported. In fact, looking at the code of compute_volume, if we are not in one of the three cases mentioned, the output volume is 0, while visual_data_new is not defined.

Similarly, the inertia computation is done only in these three cases.

It would be useful to trigger a meaningful error when the input link is not a box, cylinder or sphere, but defined by a mesh for example.

cc @CarlottaSartore

S-Dafarra commented 6 months ago

Throwing an exception in https://github.com/ami-iit/adam/pull/72/commits/8e25f0287ff3abd20ca709557c4c5f1fa29587a4 (included in https://github.com/ami-iit/adam/pull/72)