Skip to content

Acados Solver

The Acados implementation of any MPC solver uses the respective model and the Acados Solver to solve the nonlinear optimization problem.

Solver Scripts

The Acados solver is written in python (generate_acados_solver.py). In this file all constraints and costs are loaded from the <used_model>.py file. This contains the model, a definition of the used constraints and the cost. The script create_solver.sh needs to be executed to generate the solver.

Creating Solvers

cd mpc_solvers/acados/<specific_controller>/script
create_solver.sh

Recreating and building the C-Code

The C code is generated and built when the corresponding solver package is built using catkin build <solver_package_name> or crs build. Alternatively, one can manually generate code:

crs generate

CRS Interface

The file acados_mpc_solver.cpp formulates the interfaced between the solver and the CRS framework. This file is used to e.g. set model parameters used in the solver or formulate useful helper functions such as getHorizonLength(), which allow us to access solver specific information from CRS.