Skip to content

Acados Tracking MPC Solver

The Acados implementation of the Pacejka Tracking MPCC solver uses the Pacejka Model and the Acados Solver to solve the nonlinear optimization problem. It follows the structure of the Acados Pacejka MPCC Solver, however tracking a constant reference instead of a trajectory, for each stage of the mpc formulation, the following parameters need to be provided.

Solver Scripts

The Acados solver is written in python (generate_acados_solver_tracking_mpc.py). In this file all constraints and costs are loaded from the pacejka_model_tracking_mpc.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.

Recreating and building the C-Code

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

crs generate

CRS Interface

The file acados_pacejka_tracking_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.

Solver Parameters

tracking_costs

  • Q1 dX Cost : Punishes the difference in x direction to the reference
  • Q2 dY Cost : Punishes the difference in y direction to the reference
  • R1 dTorque Cost : Punishes changes in torque
  • R2 dSteer Cost : Punishes changes in steering

reference_point

  • x Reference point x coordinate
  • y Reference point y coordinate