Skip to content

longitudinal PID + lateral stanley controllers for carla simulator

Notifications You must be signed in to change notification settings

allisonhongberkeley/vehicle_control

Repository files navigation

In this project, I implemented a longitudinal PID and lateral Stanley controller to drive an ego vehicle around a given set of waypoints in the Carla simulator.

The PID controller simulates the following model:
Screen Shot 2022-06-16 at 6 27 46 PM

where Kp, Ki, and Kd are the proportional, integral, and derivative gains, respectively. The error term is defined as the difference between the desired velocity and the current velocity: e (t) = v_desired (t) - v (t). The output of the controller is the throttle input for the subsequent timestep, defined as a percentage between 0.0 and 1.0. Finally, I manually tuned the PID controller considering the following behaviors from independently manipulating each of the constant gains:


Screen Shot 2022-06-16 at 6 34 02 PM

The Stanley controller is employed to output approrpriate steering commands that keep the ego vehicle on its expected path. The Stanley method uses the center front axle of the vehicle as its reference point and the follow kinematic model:


Screen Shot 2022-06-16 at 6 36 09 PM

where δ is the steering angle, e is the crosstrack error, and ψ is the heading error.

About

longitudinal PID + lateral stanley controllers for carla simulator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages