## ← 05ps-08 Racetrack Control Solution

• 1 Követő
• 28 Sors

dummy description

### Beágyazókód kérése x Embed video Use the following code to embed this video. See our usage guide for more details on embedding. Paste this in your document somewhere (closest to the closing body tag is preferable): ```<script type="text/javascript" src='https://amara.org/embedder-iframe'></script> ``` Paste this inside your HTML body, where you want to include the widget: ```<div class="amara-embed" data-url="http://www.youtube.com/watch?v=GCJXunrJjBY" data-team="udacity"></div> ``` 2 Languages

Showing Revision 1 created 10/24/2012 by Amara Bot.

1. [Thrun] And here is my solution. We have 4 cases.
2. On the left side, if I'm on the left side of the racecourse,
3. as defined that x is smaller to radius,
4. then my crosstrack_error is defined by the distance to the circle,
6. So this is going to be 0 if I'm exactly on the circle.
7. If I'm more than 3 times over to the right side, I get a circle again.
8. It looks like the one before, but now the center of the circle is a little bit further to the right
10. The rest is identical to the line over here,
11. so I'm subtracting the same radius on the right side.
12. You can't quite see it but it's there.
13. Interesting are the straightaways.
14. So if my y value is large on the upper part of the diagram--
15. in fact, it's larger than radius--then my crosstrack_error is the y coordinate
16. times 2 times the radius, which is the height of the racetrack.
17. If I'm down at the bottom, it's just the y axis,
18. but really important is the minus sign because I'm moving in the opposite direction.
19. So for your code, to run this correctly you would have gotten everything in this routine right.
20. So that finishes my homework assignment.
21. Congratulations. You were able to make a car drive on a racetrack.
22. That is actually quite a significant component of making cars drive.
23. The PID control methodology that you learned today
24. and the smoothing methodology are really, really essential
25. not just in controlling self-driving cars but in a great number of other control setups.
26. Thank you for taking the class so far. You learned a lot already.