pyomeca / bioptim

An optimization framework that links CasADi, Ipopt, ACADOS and biorbd for Optimal Control Problem
MIT License
92 stars 46 forks source link

Removing mx_reduced by creating "biorbd wrapper" #881

Open EveCharbie opened 4 months ago

EveCharbie commented 4 months ago

This change is Reviewable

EveCharbie commented 4 months ago

@pariterre @Ipuch This is what I was thinking about for the "biorbd wrapper". I just did a proof of concept for pendulum.py to know what you guys think before I implement it for all biorbd functions. This way, we do not have to carry around mx_reduced and I think we do not need .mx anymore neither because everything can be called directly with .cx. It might get less clean when we add arguments which we cannot assume the shape (e.g. contact forces), but will still work.

Ipuch commented 4 months ago

I would advocate for a supplementary interface (BiorbdModelToCasadiFunc ?) to biorbd. An entire class that does this for every function called by biorbd so we don't have to change the current class BiorbdModel, BiorbdMultiModel, Holonomic etc ...

Also, every function of the models that do not through a MX, absolutely need to be fixed. I'm thinking about rotation matrices that are still objects of biorbd for example.

Good Job !

EveCharbie commented 1 month ago

Most of the tests are passing, but now I would need to ask you some questions @pariterre and @Ipuch :)