Roaming Vehicles

Connect

Make sure that you can answer the following questions:
– How do autonomous cars work?
– What would it take ensure that autonomous cars are safe?
– What types of movements do autonomous cars need to perform?

Think about what you have learned, then document it. Describe the problem in your own words. Creatively record your ideas and findings.

traffic-light-green

Construct

Build
Start by constructing this model.

ev3-robot-driving-base

Program
Create a program using arrays so that you can program your robot to move around the room using the EV3 Brick Buttons. The four Brick Buttons can be used as direction controls (i.e., left, right, backward, and forward).
To start, limit your program to one command.
Tip 1: Your program will have two distinct phases:

  1. Collecting data
  2. Using that data
    Tip 2: Two Loop Blocks will be needed for this lesson to allow for the two phases above.
    Tip 3: Using the Variable Block often requires a three-step process:
  3. Reading the Variable Block
  4. Adding information to the block
  5. Writing to the block to save the new data

Think about what you have learned, then document it. Describe your pseudocode for this task. Creatively record your ideas and findings.

Consider using these blocks in your solution:

layout-ex-cbs-11

Contemplate

Improve your program by using an array to record five actions for your robot.
Think about what you have learned, then document it. Describe your pseudocode for this task. Creatively record your ideas, and findings.

Consider adding these blocks to your solution:

array-operations-write-at-index-numeric

Differentiation Option
Create a MyBlock to easily edit the number of steps in your program.
To change the number of movement steps from five to something else will require you to edit both Loop Blocks within the program. This can be made much simpler by creating a My Block with a parameter. The My Block will allow the number of loops to be changed easily and clearly.
Tip 1: When creating a My Block, highlight the blocks that need to be included, but not the Start Block.
Tip 2: When you need to enter parameters at a later stage, ensure that a parameter has been added to the My Block as shown below. Use the “+” key when creating the block.
Tip 3: The parameter must be joined to the input on the block within the program. In our case, the two loops.

Share
Consider the following questions:
What challenged you? What surprised you during this lesson?
Could your program have been more streamlined? Have you used too many blocks?
Is there a more efficient way of building your program?
How could your program be used in real-world scenarios?

Think about what you have learned, then document it. Creatively record and present your ideas, creations, and findings.

Consider adding these blocks to your solution:

layout-ex-cbs-12

Continue

Explore text-based programming solutions for this activity and compare these solutions using different programming languages.