Lesson Modules
Teaching Tips:
Put this code into your VPL:
It makes your car into a remote-controlled car that can be operated using buttons on your screen. Drive the car around and try parking in a tight space (try between two textbooks). You will find that it is very difficult! Talk to students about how tough it is to park the car.
What's the most stressful part of driving?
Sitting in stop-and-go traffic can be nervewracking, and driving right in front of a police car might make your heart skip a beat. But countless guides and diagrams online suggest that the distinction goes to parking, and researchers at MIT's AgeLab have confirmed it.
Wouldn't it be nice if your car parked itself with the press of a button? Drivers have been looking for a way to avoid manual parking since we started driving, just look at this Popular Science article from 1934!
Teaching Tips:
Students should watch this video about MIT's experimental self driving car.
Question 1: What data did the researchers use sensors to measure during the experiment?
eye tracking, face cameras, distance sensors in the front and back, heart rate, skin conductivity
Question 2: What sensors would a self-parking car need?
front distance, back distance, side distance
Allow students some time to discuss these questions with their classmates.
Your teacher will show a short video. Watch carefully, then discuss these questions with your classmates.
Teaching Tips:
This code is probably the most complex the students have tackled so far, so they may need more guidance. There are likely several answers that will work well, but having strong pseudocode will be vital to completing the code section.
Now you will code your own self parking car! Start by looking back at your code from the previous lessons. Take an extra look at your code solutions to Lesson 2.
When writing this pseudocode it may be helpful to break the procedure down into it's parts and make an algorithm.
1. drive until the car senses a spot is open
2. stop
3. turn in to the spot
4. stop
Try refining this procedure in your pseudocode.
Keep in mind that in order to test this code, you will need to set up some textbooks like cars in a parking lot, with a space for your car!
Teaching Tips:
Here is the answer code for teachers:
https://www.robotlab.com/hubfs/Education.Robotlab.com/Autonomous%20Car/VPL/lesson8vpl.zip
Now it's time to translate the pseudocode you wrote into real code.
Here is some code to get you started:
Remember, writing code is like writing a poem, there are many correct answers. Maybe you answered differently. If so, I encourage you to convert your pseudocode into code and see how it works!
Teaching Tips:
Question 1: What was the coolest thing you learned today? Write your answer in the box, and see it appear which your classmates answers!
Any answer will do here. If time permits, have a short discussion with students about their answers.
Question 2: Check the concepts you understand. Don’t worry, this isn’t for a grade, it’s just so your teacher can check the classes’ understanding.
This is the students' self-assessment of their understanding of the material. You will see a bar graph once all the poll answers are submitted.
Question 3: Did your parking code work as expected?
Any answer will do here. If time permits, have a short discussion with students about their answers.
Question 4: If you could set up another experiment with your parking code, how would you do it?
Any answer will do here. If time permits, have a short discussion with students about their answers.
- IR Sensors
- Switch statement
- If statement