ahmadgazar / centroidal-MPC

GNU General Public License v3.0
0 stars 0 forks source link

Report solo12 centroidal momentum generation results using detereministic SCP in simulation #2

Open ahmadgazar opened 2 years ago

ahmadgazar commented 2 years ago

Goal:

In this issue, I report centroidal momentum generation for different gaits of solo12 in simulation. For all the following results, I follow the classic kino-dyn optimziation (i.e. tracking IK centroidal trajectories of CoM, linear momentum, and angular momentum in the cost function) with the centroidal dynamic part run with SCP to confirm that the solver implementation is not bugged. The SCP solver takes on iteration to converge, and tuning was very straight forward (all weights of the tracking cost tracking were kept the same for all the following demos)

Some implementation design details:

I decided to use functional programming style for the solver's implementation. The reason behind this is because I used JAX an auto-diff library by google, wrapped around XLA. However, there is an OOP implementation I implemented in the beginning, which uses analytical derivatives using sympy. I stopped proceeding with analytical gradients since later in the stochastic version, second-order derivatives will be required for the linearization of the chance constraints. Also, in JAX one can make use of jit complilation of the accelerated linear algebra underneath, which provides decent speeds for real-time implementation for MPC in the future. Finally, I played a bit with CasaDi, however I found JAX way more accessible in terms of documentation, and in terms of syntax it complements all numpy functions (i.e. does not require a special symbolic syntax on top like CasaDi).

Fast-trot demo

image image image

Pacing demo

image image image

Bounding demo

image image image