Project Highlight: SafeGP MPC for Autonomous Racing
Autonomous motor racing has received increased attention from the robotics and autonomous-vehicle research community in the past few years. Autonomous racing is an extremely difficult task with real implications on the autonomous vehicle industry as a whole, with key challenges including highly complex and under-actuated dynamics, safe navigation around adversarial opponents, and extremely tight constraints on computation time for real-time control. These make accurate real- time state estimation and perception, high-level reasoning about the environment, and vehicle control extremely difficult. We propose an approach to tackle two of these challenges, namely (1) optimally controlling an autonomous racing agent to drive as fast as possible around a track, and (2) reasoning about and safely avoiding collisions with potentially adversarial agents.
Collaborated with Bryan Yang
Implementation
Optimal Racing Line (color-coded by velocity)
Laptime Optimization
Offline global trajectory optimization for full-lap racing line
Distilled the optimal tradeoff between the minimum-distance and minimum-curvature path around the track into a globally optimal reference trajectory
Solved a minimum-time optimization problem (w/penalties for jerky inputs) with IPOPT through the Pyomo DAE solver
Optimal Racing Line State/Input Trajectory
Gaussian Process Intent Inference
Performed Gaussian process regression mapping from selected joint states to future opponent position
Reasons over both relative and absolute states, to learn potentially adversarial behavior from opponents
Curated diverse training dataset by simulating various scenarios at different parts of the track
Implemented and performed hyperparameter optimization with scikit-learn’s built-in GaussianProcessRegressor class, using the Matern kernel
Use first-order-hold to interpolate predicted future state into a predicted opponent trajectory
Selected Input States
Sample Gaussian Process Predicted Future Opponent Position
SafeGP MPC Optimal Control Problem Formulation
SafeGP MPC
Integrated computed optimal raceline and intent-inference into a receding-horizon MPC formulation for fast and safe racing
Penalizes deviations from the reference trajectory and jerky steering, with dynamics/ state/input constraints, and additional constraints maintaining a buffer to all opponents
Implemented in IPOPT through the CasADi package
Experiments
We demonstrate SafeGP MPC's enhanced intelligent autonomous racing capabilities by benchmarking our SafeGP MPC's performance against a set of baseline controllers. All experiments are conducted in a custom modular simulation environment in with dynamic bicycle model dynamics to configure autonomous racing scenarios, on a standard consumer-grade laptop.
Experiments: "Qualifying" Solo Lap
To compare the raw pace of the SafeGP MPC, we run a ”qualifying lap”, a full lap around the track without any opponents. We then compare this time to our baseline controllers. We find that the SafeGP MPC (which tracks the reference raceline) can complete a lap over 8 seconds faster than our baseline PID centerline-tracking controller. Comprehensive plots and experiment videos can be found at the link above.
Baseline PID Controller Solo Lap (83.6s)
SafeGP MPC Controller Solo Lap (75.3s)
Experiments: Head-to-Head VS Adversarial Agent
To test the ability of the SafeGP MPC to reason about adversarial agents, we pit it against an identical vehicle running an adversarial MPC. This adversarial MPC tracks the same racing line reference trajectory, but also responds to the nearest opponent behind by trying to match lateral position on track, effectively performing a blocking maneuver with the intent of causing a crash. The adversarial opponent is handicapped to 80% of maximum acceleration in all scenarios to make an overtaking maneuver physically possible. We find that for all of the controllers considered, only the SafeGP MPC is able to safely avoid collision and overtake the adversary, whereas the others result in crashing or insufficient speed to catch up. Comprehensive plots and experiment videos can be found at the link above.
Baseline PID Controller Straight Head-to-Head: CRASH
Baseline PID Controller Curve Head-to-Head: ADV PULLS AWAY
Baseline Blind MPC Straight Head-to-Head: CRASH
Baseline Blind MPC Straight Head-to-Head: EQUAL
SafeGP MPC Straight Head-to-Head: OVERTAKE
SafeGP MPC Curve Head-to-Head: OVERTAKE
Experiments: Interesting Behaviors
Included are clips of some interesting observed behaviors by the SafeGP MPC in navigating various autonomous racing scenarios
Avoiding Faster Opponent: Track vehicles behind and take evasive action if the vehicle is projected to crash into the ego agent
Track Multiple Opponents: Predict/react to future behavior for multiple opponents simultaneously (including other SafeGP MPC agents)
Change Opponent Attention: Configured to only track one opponent at a time, so switches attention to whichever opponent is closer
Avoiding Faster Opponent from Behind
Track Multiple Opponents
Change Opponent Attention