ethz-adrl / control-toolbox

The Control Toolbox - An Open-Source C++ Library for Robotics, Optimal and Model Predictive Control
BSD 2-Clause "Simplified" License
1.44k stars 311 forks source link

Convex MPC #122

Closed mahumada408 closed 4 years ago

mahumada408 commented 4 years ago

Hi,

I wanted to know if you have any thoughts on where I should get started to solve convex MPC problems with the control toolbox. For example, would you be able to use this architecture to solve the MPC problem in the MIT Cheetah (and mini Cheetah), and use Gazebo as the simulation platform? I have a gazebo sim of a small quadruped ready to go, and I'd like to control it with an MPC. If you could give me any tips, I would highly appreciate it.

I'd love to give this a shot!

Cheetah Paper https://doi.org/10.1109/IROS.2018.8594448

Thank!

markusgft commented 4 years ago

Dear @mahumada408 The CT does unfortunately not come with a default gazebo integration, but it is certainly a tool which can help you in solving the mentioned MPC problems. For communicating with gazebo, you could for instance use ROS. If you are interested in seeing CT examples with ROS integration, including a motion optimization task for a quadruped, I can recommend you checking out the examples in the accompanying repository ct_ros. Best!

mahumada408 commented 4 years ago

Great! I'll take a look at ct_ros. Are there any examples on how to solve a convex MPC with CT?

markusgft commented 4 years ago

Well, basically all the linear-quadratic examples and unit tests are convex problems, which may serve as examples for you!

erwincoumans commented 4 years ago

You may also get some inspiration from their repository, both control and simulator of the MIT Cheetah is open source here: https://github.com/mit-biomimetics/Cheetah-Software (search for LQR and QP)

mahumada408 commented 4 years ago

@markusgft thanks for pointing out the linear quadradic examples. I realize that most of those are LQR problems with no constraints. How could I set the problem up with constraints? At that point, I assume I would need to use IPOPT, right?

@erwincoumans thanks, I didn't realize that the control code for Cheetah was open source. I'll definitely take a look and try to implement it with this toolbox in ROS!

markusgft commented 4 years ago

Here is an example with box constraints, in the same folder there is an example which uses general inequality constraints. The solver which is employed for the constrained LQ problems is HPIPM, which you can install using the convenience bash script in the /ct folder.