ShuoYangRobotics / A1-QP-MPC-Controller

An open source implementation of MIT Cheetah 3 controllers
GNU Affero General Public License v3.0
631 stars 130 forks source link

About your new implementation mentioned in README and Issue #22 #35

Open jbwenjoy opened 3 months ago

jbwenjoy commented 3 months ago

Hi, Shuo Yang,

Thank you so much for this awesome repo!

I noticed both in README and in another issue (https://github.com/ShuoYangRobotics/A1-QP-MPC-Controller/issues/22) you mentioned a newer implementation

Update 2022-12-05

Dear friends, since the release of this code base we got feedback on various aspects. A revised MPC controller is developed at CMU REX Lab Github. Please try the revised version. I will continue the development there.

  1. in convex MPC, an astonishing fact is - the actual value of inertia does not matter because when you tune the Q and R matrices, they implicitly account for the scale of the inertia.
  2. the short horizon is due to a rudimentary usage of osqp. I initialize osqp solver within each control loop so it causes additional memory allocations which are not necessary. In our new implementation (new code), the problem is solved by a better osqp initialization logic. So we can use 0.05s as di and solve for 30 steps within 5ms.
  3. I tried using the predicted contact sequence in the new implementation as well. No visble difference. The robot can run faster indeed in simulation. But I do not think about how to quantify how much improvement this can bring too the system.

I'm curious about how you made it possible to solve 30 steps within 5ms (what kind of hardware are you using?). But that repo is currently not available. If it's still open-source, can you provide a new link?

Thanks again!

jbwenjoy commented 3 months ago

Update: I guess I find it here: https://github.com/zha0ming1e/legged_mpc_control