Skip to content

[New Feature] Model Predictive Control(MPC) for Path Tracking#73

Open
mohitk3000 wants to merge 6 commits intoShisatoYano:mainfrom
mohitk3000:feature-mpc_path_tracking
Open

[New Feature] Model Predictive Control(MPC) for Path Tracking#73
mohitk3000 wants to merge 6 commits intoShisatoYano:mainfrom
mohitk3000:feature-mpc_path_tracking

Conversation

@mohitk3000
Copy link
Copy Markdown
Contributor

Description

The controller uses a receding-horizon NLP formulation built on CasADi and do-mpc, with a discrete-time bicycle kinematic model, time-varying reference trajectory (TVP), and IPOPT as the backend solver. The public interface mirrors MppiController, so either controller can be swapped into the same simulation loop without changes.


Checkpoints:

  • Cost Function — Implemented stage cost (tracking error + control effort) and terminal cost (heavier tracking weights), with angle-safe yaw error via atan2.
  • Smoothness Penalty — Add rterm (Δu penalty) via mpc.set_rterm() to penalize rapid control changes
  • Hard Constraints — Enforce box constraints on steering angle, acceleration, and vehicle speed
  • Solver Integration — Install CasADi and do-mpc in the Docker container.
  • Sample Simulation — Created a simulation script to follow a reference course.
  • Visualization — Plot the MPC predicted (optimal) trajectory as a dashed line alongside the vehicle.

@ShisatoYano ShisatoYano self-requested a review April 19, 2026 08:23
@ShisatoYano ShisatoYano added the enhancement New feature or request label Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants