MINDSTORMS EV3 Core Set

Autonomous Parking

Design cars that can park themselves safely without driver intervention.

45-90 min.
Beginner
Years 7-9 or Key Stage 3
auto-parking-connect

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.

ev3-robot-driving-base

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

coding-01-01
  1. Start the Program
  2. Turn the driving base and stop after 1.5 seconds.
  3. Turn the driving base left and stop after 1 second.
  4. Move the driving base forward for 3 seconds.
DOWNLOAD SAMPLE PROGRAM7 KB, Requires EV3 Desktop Software

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

coding-01-02
  1. Start the Program.
  2. Drive forward in a straight line at the desired speed.
  3. Wait for 1 second.
  4. Reverse motor rotation while turning for 1,5 rotation.
  5. Reverse motor rotation while turning the other way for 1,5 rotation.
  6. Drive backward in a straight line for 0,5 rotation.
  7. Drive forward in a straight line for 1 rotation.
DOWNLOAD SAMPLE CODE7 KB, Requires EV3 Desktop Software

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

coding-01-03
  1. Start the Program.
  2. Drive forward in a straight line at the desired speed.
  3. Wait for 1 second.
  4. Turn light on (reverse light).
  5. Reverse motor rotation while turning for 1.5 rotation.
  6. Reverse motor rotation while turning the other way for 1.5 rotation.
  7. Drive backward in a straight line for 0.5 rotation.
  8. Drive forward in a straight line for 1 rotation.
DOWNLOAD SAMPLE CODE7 KB, Requires EV3 Desktop Software

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);
}

DOWNLOAD SAMPLE CODE1 KB, Requires ROBOTC Software

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.

Guide to reinstalling EV3 Brick

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

DOWNLOAD SAMPLE CODE1 KB, Requires ROBOTC Software

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

DOWNLOAD SAMPLE CODE1 KB, Requires ROBOTC Software

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

Pupil Material

Student Worksheet

Download to view and share the student worksheet.

Share with:

Google ClassroomGoogle Classroom