# MPC Planner for NXPCup Race Car This repository contains the implementation of a Model Predictive Control (MPC) planner developed for the NXPCup autonomous race car competition. Unlike traditional reactive controllers, this planner uses real-time trajectory optimization to improve cornering and speed control. The project includes tools for track creation ## Installation and Running To run the planner and simulation tools, follow these steps: 1. **Download ACADOS** to `/acados` and build it by following the instructions in the official documentation: https://docs.acados.org/installation/ 2. **Install the Python interface for ACADOS** as described here: https://docs.acados.org/python_interface/index.html 3. **Install required Python dependencies** using pip: ```bash pip install pygame matplotlib numpy ``` 4. **Set environment variables** (if needed): If you encounter issues, make sure the required environment variables are correctly exported: ```bash source export_acados.sh ``` This script is located in the project root folder. --- ### Run Apps - `track_gen.py` – Interactive track generation tool. Allows adding/removing segments and exporting the layout. - `run_simulation.py` – Runs the MPC planners under various initial conditions and visualizes results.