Skip to the content.

Lab Tasks

For this lab, I decided to implememt the drift task. Below is the code that I used, which draws on previous labs:

I first get the car to an appropiate distance from the wall, then the car does a 180 turn and drives in the direction it came from. I decided to only use P control because I knew that with an appropiate selection of the goal rotation angle the potential overshoot present would be negligable (and due to time constraints). At first, this led to a wide variation between trials:

But after tuning the target angle I was able to get better results:

To get more of a drift effect, what I could do is keep the wheels spinning faster when the car is doing the 180.

Acknowledgements

I referenced past students Mikayla Lahr’s and Nila Narayan’s websites for code setup.