Real-time performance is one of the major challenges for optimal control and MPC control. In this paper, a novel general open-source C++ MPC solver based on state-of-the-art sparse QP solver OSQP is designed to solve the motion control problem of autonomous vehicles efficiently. A new linear dynamic model is proposed by replacing heading angle error with planning lateral projection speed, whose measurement is independent of the measurement of heading angle. A general local linearization method for the nonlinear tire model is proposed. Through the theory of offset-free MPC control, the steady-state value problem is solved caused by a disturbance in the time domain systematically. The algorithm in this paper is implemented in ROS, which means that the algorithm can be directly used in the prototype development of autonomous vehicles. The proposed MPC solver can solve a linear time-varying or time-invariant system, with or without disturbances. It is very efficient and can handle different kinds of hard and soft constraints. A real-time simulation platform based on Unreal Engine 4 and CarSim is designed to verify the algorithm’s effectiveness. Real-time simulations and real vehicle experiments verify the efficiency of the algorithm.
Read full abstract