Teacher Handbook – Middle School

Intermediate Level

Demonstration Lesson: Introduction to AI

Teacher Resources 0.1

Robotics v.s. AI

In short, robotics and AI are different concepts. There are some overlaps where robots are powered by AI technologies. See the Venn diagram below that depicts the relationship between the two.

Students may confuse the two, thinking all robots are intelligent and/or that AI requires robots.

Robotics Overlapping AI
Robotic arms in the video, Vex Robots, Lego Mindstorm, Drones Self-driving cars, Cozmos, Boston Dynamics, Roomba 980 Search engines, Content recommendation, Image classifiers

So, the question becomes, what makes a robot “smart”?

In short, “smart” robots have the ability to make decisions based on what it senses so they are not just acting on a pre-programmed sequence.

For example, you can easily program a robot to move forward for a certain distance and make a ninety-degree turn. But that’s all there is. The robot repeatedly performs this script. It will not make any adjustments to its behavior based on what it senses.

A “smart” robot, on the other hand, will be able to make decisions. If you program an AI robot like Cozmo to chase an object it recognizes, such as a cube, Cozmo will be able to locate the cube and move toward it regardless of where you put the cube. In a larger sense using the example of self-driving cars, there is certainly no pre-programmed path or script of how the vehicle would act. Hence, they are “smart.”

Teacher Resources 0.2

Teacher Resources 0.3

Teacher Resources 0.4

Download Calypso File: Naming Algorithm

  1. Make sure Cozmo doesn’t see anything in view.
  2. Press “Backspace”(Windows)/”Delete”(Mac) to enter execution mode.
  3. In any order you wish, show Cozmo one thing at a time:
    • Cube 1
    • Cube 2
    • Cube 3
    • Charger
  4. Cozmo will name what he sees.

Teacher Resources 0.5

Download Calypso File: Ready For Green Light

Make sure Cozmo doesn’t see anything in view and is off his charger.

  1. Put a cube about one foot away from him where he can see.
  2. Press “Backspace”(Windows)/”Delete”(Mac) to enter execution mode.
  3. The cube will turn red. Cozmo will not move.
  4. Tap the cube once, the cube will turn green.
  5. Cozmo will move towards the cube.

Teacher Resources 0.6

Download Calypso File: Grab a Cube 

  1. Make sure Cozmo doesn’t have anything in his view and is off his charger.
  2. Press “Backspace”(Windows)/”Delete”(Mac) to enter execution mode.
  3. Put a cube about one foot away from him where he can see.
  4. Observe how Cozmo picks up the cube. If the cube is not directly aligned with Cozmo, observe how Cozmo intuitively adjusts his angle to approach the cube.

Teacher Resources 0.7

Below is a list of the tasks on Handout 0.2 along with their solutions. Click Here(Page 13-ish) for a tutorial of Calypso’s interface.

Set up my AI-IN-A-BOX™ See Quick Guide
Teach Cozmo to recognize me and say “Hello”
Teach Cozmo to recognize his cubes
teach Cozmo to say my name
Teach Cozmo to say the names of objects he recognizes Download Calypso File: Naming Algorithm 
Teach Cozmo to move toward a cube
Teach Cozmo to navigate to a cube and leave it
Teach Cozmo to express “playful” when he gets near a cube

Teacher Resources 0.8

Lesson 1

Teacher Resources 1.1

The survey measures student’s perception of AI and AI-powered robots in terms of the capabilities and applications. 10 Questions are selected for this grade level. They correspond to the 6 AI aspects that are taught through this course.

When having students complete the survey, it helps to explain the metrics using the example at the beginning of the handout.

Teacher Resources 1.2

Robotics v.s. AI

In short, robotics and AI are different concepts. There are some overlaps where robots are powered by AI technologies. See the Venn diagram below that depicts the relationship between the two.

Students may confuse the two, thinking all robots are intelligent and/or that AI requires robots.

Robotics Overlapping AI
Robotic arms in the video, Vex Robots, Lego Mindstorm, Drones Self-driving cars, Cozmos, Boston Dynamics, Roomba 980 Search engines, Content recommendation, Image classifiers

So, the question becomes, what makes a robot “smart”?

In short, “smart” robots have the ability to make decisions based on what it senses so they are not just acting on a pre-programmed sequence.

For example, you can easily program a robot to move forward for a certain distance and make a ninety-degree turn. But that’s all there is. The robot repeatedly performs this script. It will not make any adjustments to its behavior based on what it senses.

A “smart” robot, on the other hand, will be able to make decisions. If you program an AI robot like Cozmo to chase an object it recognizes, such as a cube, Cozmo will be able to locate the cube and move toward it regardless of where you put the cube. In a larger sense using the example of self-driving cars, there is certainly no pre-programmed path or script of how the vehicle would act. Hence, they are “smart.”

Teacher Resources 1.3

  1. Make sure all the groups have Calypso open correctly: they should be able to see the camera viewer on the screen. Occasionally, students will run the simulator mode when things are not entirely connected correctly.
  2. Ask the students what they see in the camera viewer.
  3. Have the Cozmo Operator pick up Cozmo and point the camera at another student.
  4. Ask what they see except for the face and the background. Prompt students until they realize the green box/frame around any recognized faces.
  5. Note: the frame is only visible when faces are recognized. For that to happen, the entire face needs to be visible to the camera, and the contrast between the face and the background should be high.

Teacher Resources 1.4

Activity: What else does Cozmo recognize? (Object recognition)

*Cozmo can recognize human faces, his three light cubes, the front of his charger, and custom markers (included in the AI-IN-A-BOX™).

  1. Ask, “What else can Cozmo recognize?” — per students requests, place other objects (a hand, any random objects they propose) in Cozmo’s camera’s view.
  2. Draw the conclusion that Cozmo will only put a frame on an object that he recognizes.
  3. Furthermore, move a light cube around in front of Cozmo. He will not be able to recognize the cube unless the ENTIRE cube is seen.

Teacher Resources 1.5

Prompt students by asking them to list actions that are possible by Cozmo. As they explore, they should be able to list answers from the menu of Calypso.

Most of the icons are rather self-explanatory. For the ones that aren’t, like “game”, feel free to skip them until mentioned later.

Another way to guide the activity is to ask students to draw parallels from themselves: what are the senses that we have? Can Cozmo do some of what we can do?

Lesson 2

Teacher Resources 2.1

Dogs are smart in many ways. Some of the possible answers are:

  • Dogs have eye contact with us.
  • Dogs can play games and understand simple rules.
  • Dogs recognize certain people.
  • Dogs follow human cues like hand gestures and verbal commands.

For more, refer to this Wikipedia page (https://en.wikipedia.org/wiki/Dog_intelligence#Awareness).

Teacher Resources 2.2

In this case, “The documents claim that one or more safety systems or devices had failed, which led to the incident.” While we can’t know for sure about what happened, we know it’s not a “rogue robot” killing the worker. In short, current AI applications focus on individual areas, meaning AI helps with specific tasks, like recognizing faces, recommend songs based on users’ history, etc.

It would take what’s called “artificial general intelligence (AGI)” or even more for robots to have a mind to even contemplate or be aware of the action of “killing”. And, we are quite far away from even the simplest form of AGI. See this Forbes article (https://www.forbes.com/sites/forbestechcouncil/2018/08/28/how-far-are-we-from-truly-human-like-ai/#54bf807431ac) for more on the topic.

That being said, safety regulations regarding autonomous or semi-autonomous devices should be reinforced to avoid tragedies like this.

Teacher Resources 2.3

In this activity, once students involved recognition in the discussion, you can start with reviewing what Cozmo can recognize (refer to Teacher Resources 1.4 for details).

Students can then experiment on how Cozmo can react based on what he sees.

Download Calypso File: Naming Algorithm

Make sure Cozmo doesn’t see anything in view.

  1. Press “Backspace”(Windows)/”Delete”(Mac) to enter execution mode.
  2. In any order you wish, show Cozmo one object at a time:
    1. Cube 1
    2. Cube 2
    3. Cube 3
    4. Charger
  3. Cozmo will name what he sees.

A simple next step would be imagining one of the cubes being a human worker. What would AI robots do?

Teacher Resources 2.4

Download Calypso File: Safety Warning

  1. This program is a slight variation of the Naming Algorithm (Teacher Resources 2.3).
  2. As the lesson goes, Cozmo is an AI robot in a car production plant.
  3. We identify Cube 1 as a “car” which Cozmo can operate on, while Cube 2 is identified as a human worker.
  4. Press “Backspace”(Windows)/”Delete”(Mac) to enter execution mode.
  5. While Cozmo is on his charger, place Cube 1 in the camera’s view.
  6. Cozmo will glow green indicating everything is normal. Cube 1 can be put away.
  7. Place Cube 2 in the camera’s view. Cozmo will say “This area is dangerous. Please leave.” and glow red indicating warning. If Cozmo sees his charger, he’ll name the charger.

Teacher Resources 2.5

Indenting a Rule

In Safety Warning, we saw a line that is indented. See the second line here.

What does that mean?

So far what we have learned has been “one condition to one action”. In short, this indented line means adding an additional action to the same condition.

The original line is called a “parent rule”. If its condition (the When clause) is true, the action (the Do clause) will be executed. At the same time, the indented rule will be considered as long as the condition of the parent clause is true. In our example, the indented line will be considered when and only when Cozmo sees Cube 2 in-frame. When that happens, the condition of the indented rule has to be true for its corresponding action to take place. In our example, since the When clause of the indented rule is empty, that means it’s always true. So, to sum up, as long as Cozmo sees Cube 2 in-frame, he’ll glow red.

To better illustrate the point and explain the idea of indentation, you can have students add a condition to the indented rule.

In this case, Cozmo will only glow red when he sees both Cube 2 and 3 in-frame. If he only sees Cube 2, he will speak but he will not glow red. If he only sees Cube 3, he will not do anything.

To indent the rule, click on the WHEN tile with the mouse and drag the rule to the desired position. You can also use the A button on the controller when the pencil is on the WHEN tile to pick up the line. The line can be moved around using the directional keys and dropped using the A button again.

Teacher Resources 2.6

We can program Cozmo to speak English by using the SAY tile (available after the DO tile). Any words can be typed in the text box that pops up. 

Suggestion: always add an extra ONCE tile after SAY unless told otherwise. This restricts Cozmo to only say the sentence once.

Lesson 3

Teacher Resources 3.1

What AI “heard” What may have been said
1. Find something with such cream. Find something with a touchscreen.
2. Wreck a nice beach. Recognize speech.
3. My chess caught that home. I just got back home.
4. You got us into humor. You’ve got a sense of humor.

See the following article for more information:

Hammond, Simon. “When Speech Recognition Goes Wrong.” Appen. Mar. 14, 2017. https://appen.com/when-speech-recognition-goes-wrong/

Teacher Resources 3.2

Teacher Resources 3.3

Teacher Resources 3.4

Teacher Resources 3.5

Use the above two boxes to program

a) how Cozmo responds when he sees “fire”; and

b) how Cozmo responds when hears “fire.”

This is a very basic activity where functions are combined. See the program below for reference. Students can program anything that they wish.

A higher level of combination can be something like the following:

Lesson 4

Teacher Resources 4.1

In a sequential setting, events in a program happen in order. One thing leads to another and the completion of later events rely on the occurrence of earlier events. This is widely used in automation, especially where actions are highly scripted and few variables are included.

In a rule-based setting, however, the program is a set of rules. In our case, Cozmo follows all the rules that are given to him in Calypso. Actions happen when and only when the condition is true. So, there is no difference if we switch the order of the rules that are parallel. This is more suitable for smart robots, who have to deal with complex situations containing multiple variables that could affect the robots’ behavior at the same time.

Teacher Resources 4.2

Now that students have tried to be “programed” in a sequential way, you can let them experience the difference stated in Teacher Resources 4.1 by providing them a set of rules and “run” the program several times while altering the obstacles.

Place the desk between the student who’s playing Cozmo and student A. Ask the students to write down the sequential code for navigating to student A. Then move the desk closer or farther to either side. Most likely the original sequential code will fail because it is based on how the obstacle was placed.

Now try the rule-based code:

  1. When see [Student A], move toward [Student A]
  2. When bumped an obstacle, turn left and move around it.
  3. When bumped [Student A], say [student input]

Once the Cozmo student understands the rules, you can move the obstacles around and it shouldn’t be a problem for him/her.

Lesson 5

Teacher Resources 5.1

coming soon

Teacher Resources 5.2

Cozmo can interact with the cubes by picking them up. To program Cozmo to do so, you’ll need the following rules. Cozmo might take a few tries but eventually, he’ll get it.

You can rotate the target cube to make it more difficult for Cozmo because he would have to adjust the angle he approaches the cube.

In contrast, Cozmo can be operated by students using the controller. To do so, on a new page, put in:

In execution mode, the left stick controls Cozmo’s movement, while the left and right bumpers control his arm.

After a few tries, students might find it easy to pick up the cube by teleoperation. It’s time to make it “fair” by allowing the students to only look at the camera viewer but not the actual robot/cube. This will make it significantly more difficult for them, but it lets them understand how much information is available to Cozmo compared to us. Humans have two eyes that allow for depth perception, and we are looking at the robot from a higher and adjustable angle.

Lesson 6

Teacher Resources 6.1

In this video, the robot does a few things. It knows its surroundings, recognizes dog feces, and picks them up. In the context of our course, the robot does object recognition, landmark-based navigation, and object manipulation. The students should know all of them by this lesson.

For more on how this robot works and the story behind the developers of it, check out this video: https://www.youtube.com/watch?v=-FBHA6_7CL4

Lesson 8

Teacher Resources 8.1

Take this simple program as an example:

What we want to achieve is actually having Cozmo move to the cube when he sees it and grab it when he’s close enough. But, the program above will not work. The problem is with the indentation. When the program above is executed, Cozmo will move toward the first cube he sees in-frame, then as he gets closer, he will stop moving. But at this point, he stops being able to see the cube in-frame because he’s too close up. So the first line, which is the parent rule, is not true. Therefore, the second line will not be considered at all. The correct way to program this is below.

Another common error is: