Autonomous Parking
Design cars that can park themselves safely without driver intervention.
Connect
(5 minutes)
Ignite a classroom discussion around the following questions:
- How do autonomous cars work?
- What would it take to ensure that autonomous cars are safe?
- What types of movements do autonomous cars need to perform?
Allow the students to select the tool(s) they find most appropriate for capturing and sharing their ideas. Encourage them document their thoughts using text, videos, images, sketchnotes, or another creative medium.
Construct
(15 to 30 minutes)
Set up
Before assigning the next task, make sure that you have marked the path the robots must follow and that there is enough space to complete the task. It is a good idea to have students work on a big table or on the floor.
Build
Students will construct the Robot Educator base model, which is a basic wheeled robot.
Have the students perform the following building check before they program their robots:
- Are the wires correctly connected from the motors to ports B and C?
- Are the wheels correctly installed?
- Are the wheels rotating freely?
Program
Have the students begin a new project in the EV3 programming environment.
Have them practice by creating a program that will make the robot turn three times.
Encourage the students to explore different ways of making the wheeled robot move. Have them describe the effect(s) of altering the parameters of each of the blocks that they use.
POSSIBLE SOLUTION: THREE POINT TURN
- Start the Program
- Turn the driving base and stop after 1.5 seconds.
- Turn the driving base left and stop after 1 second.
- Move the driving base forward for 3 seconds.
Note
Refer students to the Robot Educator Tutorials for further assistance.
In the EV3 Software :
Robot Educator > Basics > Straight Move
Robot Educator > Basics > Curved Move
Robot Educator > Basics > Tank Move
In the EV3 Programming App :
Robot Educator > Curved Move
Contemplate
(35 minutes)
Have the students choose one or all of these autonomous driving scenarios to program:
- Parallel parking
- Angle parking
- Perpendicular parking
They should use a different Programming Canvas for each solution.
Allow the students to select the tool(s) they find most appropriate for capturing and sharing their pseudocode. Encourage them to use text, videos, images, sketchnotes, or another creative medium.
POSSIBLE SOLUTION: PARALLEL PARKING IN AUTONOMOUS MODE
- Start the Program.
- Drive forward in a straight line at the desired speed.
- Wait for 1 second.
- Reverse motor rotation while turning for 1,5 rotation.
- Reverse motor rotation while turning the other way for 1,5 rotation.
- Drive backward in a straight line for 0,5 rotation.
- Drive forward in a straight line for 1 rotation.
Differentiation Option
Have the students create a program that simulates appropriate warning lights while parking (e.g., use the EV3 Brick Status Light to display reverse warning lights).
POSSIBLE SOLUTION: SIMULATING REVERSE GEAR AND REVERSE WARNING LIGHTS
- Start the Program.
- Drive forward in a straight line at the desired speed.
- Wait for 1 second.
- Turn light on (reverse light).
- Reverse motor rotation while turning for 1.5 rotation.
- Reverse motor rotation while turning the other way for 1.5 rotation.
- Drive backward in a straight line for 0.5 rotation.
- Drive forward in a straight line for 1 rotation.
Share
Allow the students to select the tool(s) they find most appropriate for capturing and sharing their creations, unique thinking, and learning process. Encourage them to use text, videos, images, sketchnotes, or another creative medium.
Ask one or two groups to demonstrate their programs. Discuss what works well and what could be improved.
Assessment Opportunity
Specific rubrics for assessing computational thinking skills can be found under 'Assessment'.
Continue
(45 Minutes)
Using Text-Based Programming
Have the students explore text-based programming solutions so they can compare different programming languages.
MakeCode - POSSIBLE SOLUTION
Program with Blocks or JavaScript in your web browser using Microsoft MakeCode editor for LEGO® MINDSTORMS® Education EV3.
You can find the Autonomous Parking Activity Here
Swift Playground - POSSIBLE SOLUTION
ev3.move(forSeconds: 1.5, leftPort: .b, rightPort: .c, leftPower: 50, rightPower: 17)
ev3.move(forSeconds: 1, leftPort: .b, rightPort: .c, leftPower: -17, rightPower: -50)
ev3.move(forSeconds: 3, leftPort: .b, rightPort: .c, leftPower: 50, rightPower: 50)
ROBOT C - POSSIBLE SOLUTION
#pragma config(StandardModel, "EV3_REMBOT")
//*!!Code automatically generated by 'ROBOTC' configuration wizard!!*//
/*
Create a three point turn using timing and steering.
*/
task main()
{
//Turn to the right and stop after 1.5 seconds.
setMotorSpeed(motorB, 50);
setMotorSpeed(motorC, 17);
sleep(1500);
//Reverse to the left and stop after 1 second.
setMotorSpeed(motorB, -17);
setMotorSpeed(motorC, -50);
sleep(1000);
//You should now be straight and facing the other way. Drive off.
setMotorSpeed(motorB, 50);
setMotorSpeed(motorC, 50);
sleep(3000);
}
Warning! This may be dangerous!
LEGO Education has no ownership of the ROBOTC platform and does not provide any support or guarantee of the quality of the user experience and technology used. All required set up information is provided by ROBOTC at robotc.net. We recommend always to reinstall the official LEGO MINDSTORMS EV3 Brick firmware when you finish using other programming languages.
Other Program solutions
Swift Playground - POSSIBLE SOLUTION
ev3.move (forSeconds: 1, left Port: .b, rightPort: .c, leftPower: 50, rightPower: 50)
ev3.move (for Rotations: 1.5, left Port: .b, rightPort: .c, leftPower: -70, rightPower: -30)
ev3.move (for Rotations: 1.5, left Port: .b, rightPort: .c, leftPower: -30, rightPower: -70)
ev3.move (for Rotations: 0.5, left Port: .b, rightPort: .c, leftPower: -50, rightPower: -50)
ev3.move (for Rotations: 1, left Port: .b, rightPort: .c, leftPower: 50, rightPower: 50)
ROBOT C - POSSIBLE SOLUTION
Swift Playground - POSSIBLE SOLUTION
ev3.move (forSeconds : 1, left Port: . b, rightPort: . c, leftPower: 50, rightPower: 50)
ev3.brickLightOn (With Color: .orange, inMode: .on)
ev3.move (for Rotations: 1.5, leftPort: .b, rightPort: .c, leftPower: -70, rightPower: -30)
ev3.move (for Rotations: 1.5, leftPort: .b, rightPort: .c, leftPower: -30, rightPower : -70)
ev3.move (for Rotations: 0.5, leftPort: .b, rightPort: .c, leftPower: -50, rightPower: -50)
ev3.move (for Rotations: 1, leftPort: .b, rightPort: .c, leftPower: 50, rightPower: 50)
ROBOT C - POSSIBLE SOLUTION
Teacher Support
Students will:
Understand that algorithms are capable of carrying out a series of instructions in order.
Explore the concept of Outputs by compare different ways in which a wheeled robot can move.
NGSS
MS-ETS1-1. / MS-ETS1-2. / MS-ETS1-3. / MS-ETS1-4.
CSTA
2-A-2-1 / 2-A-7-1 / 2-A-7-3 / 2-A-7-4 / 2-A-5-5 / 2-A-3-9 / 2-A-6-10 / 2-C-4-12 / 2-D-5-16 / 2-I-1-20