1 of 62

SMART ROBOTS�CAMP

OAK RIDGE COMPUTER SCIENCE GIRLS

ORCSGirls

ORCSGirls

Smart Robot Camp

2 of 62

RULES

  • Treat each other, the volunteers and the facilities with respect.
  • Raise your hand if you have a question or want to answer.
  • Only visit the websites needed for the class project.
  • Always follow instructions by volunteers.
  • Wait in the room until you are picked up at the end of the day.
  • Be gentle with the robots!
  • Help each other.
  • Enjoy!

Smart Robot Camp

3 of 62

Introductions

Welcome to our online class.

Today’s instructor and volunteers

Thomas Proffen

Katie Schuman

Addison Malone

Amelie Nagle

Grace Feng

Yvonne Dalschen

Smart Robot Camp

4 of 62

GETTING TO KNOW EACH OTHER�BINGO

Smart Robot Camp

5 of 62

Schedule

Monday

Tuesday

Wednesday

Thursday

Introduction to Python

JupyterLab and Widgets

Machine Learning

Katie Schuman

Project: Object detection

Project: Road following

Lunch

Lunch

Lunch

Lunch

Getting to know JetBot

JetBot Remote Control

Project: Collision Avoidance

Project: Object detection

Project: Road following cont.

Parent Showcase

Smart Robot Camp

6 of 62

This is an Advanced Camp

Things to remember

  • You got this!
  • Do not give up if somethings seems hard in the beginning.
  • Ask questions.
  • All of us ‘google’ things all the time.
  • Nobody writes code that works right away.
  • Debugging can be frustrating, but it is super sweet if things work in the end.
  • We have a flexible schedule.
  • Have fun!

Smart Robot Camp

7 of 62

Introduction to Python

Day 1 - Morning

Smart Robot Camp

8 of 62

WHAT IS PYTHON?

  • Python is an interpretive programming language.
  • Python was created by Guido van Rossum in 1989.
  • Named after his love for the comedy series Monty Python’s Flying Circus – not the snake.
  • Benefits
    • Easy to learn.
    • Free to use and open source.
    • Portable, extensible, and embeddable.
    • Object oriented language.
  • Fastest growing programming language.

Source: Wikipedia

?

Smart Robot Camp

9 of 62

WHAT ARE JUPYTER NOTEBOOKS?

The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text.

www.jupyter.org

Analyzing neutron scattering data at ORNL using Jupyter notebooks.

Smart Robot Camp

10 of 62

Jupyter Lab

ls

Lists all files and directories - ls -l

mv

Move file - mv file1 file2

cd

Change directory - cd dir, cd ..

sudo <cmd>

Run command <cmd> as administrator

pwd

Show current working directory

shutdown

Shut down Pi - sudo shutdown now

mkdir

Make new directory - mkdir newdir

cat

Show content of text file - cat file

cp

Copy file - cp file1 file2

top

Show running processes (use ‘q’ to exit)

Files

New Python Notebook

Open terminal

Smart Robot Camp

11 of 62

Activity

Open a browser and visit

https://jupyter.orcsgirls.org

Username:

Your first name, all lower case

Password:

First login you set your password. Do not forget it :)

Python introduction

Objects in Python

Using Widgets

Smart Robot Camp

Smart Robot Camp

12 of 62

Getting to know JetBot

Day 1 - Afternoon

Smart Robot Camp

13 of 62

Pair Programming

Two girls

One laptop

One robot

Unstoppable

Smart Robot Camp

14 of 62

Driver

  • Write the code according to the navigator's specification
  • Listen intently to the navigators instructions
  • Ask questions wherever there is a lack of clarity
  • Offer alternative solutions if you disagree with the navigator
  • If there is disagreement, defer to navigator. If idea fails, get to failure quickly and move on
  • Make sure code is clean
  • Own the computer / keyboard
  • Ignore larger issues and focus on the task at hand
  • Trust the navigator - ultimately the navigator has the final say in what is written
  • You are writing the code

Smart Robot Camp

15 of 62

Navigator

  • Dictates the code that is to be written - the 'what'
  • Clearly communicates what code to write
  • Explains 'why' they have chosen the particular solution to this problem
  • Check for syntax / type errors as the Driver drives
  • Be the safety net for the driver
  • Make sure that the driver sticks to the small task at hand
  • Outline and note down high level tasks / issues
  • Ongoing code review
  • Pay attention
  • Wait until the task is complete to bring up design / refactoring issues

Responsible for robot safety!

Smart Robot Camp

16 of 62

Both

  • Actively take part in programming
  • Aim for optimal flow - avoid trying to be 'right'
  • Embrace your role
  • Intervene if your pair is quiet
  • Know when to give up / steal keyboard
  • Communicate, communicate, COMMUNICATE!
  • Don't hog the keyboard
  • High-five every time something works high
  • Swap roles frequently

Smart Robot Camp

17 of 62

Robot rules

  • Do not push the robot
  • Do not move the antennas
  • Careful with the cable going to the camera
  • Use proper shutdown before powering off
  • Careful with the fan
  • Do not lose the camera cap
  • The navigator is responsible for robot safety when notebooks are executed and the robot might move.

Smart Robot Camp

18 of 62

Robot Time!

  • Pair up
  • Check the number on your robot
  • Turn on the robot and wait until the IP address shows on the little screen
  • Connect the laptop for the WiFi named ORCSGirls
  • In a web browser visit jetbotX.local:8888 (X is the number of your jetbot)

Make sure you connect to your robot!

Caution - robot will move when running commands in the notebook!

Smart Robot Camp

19 of 62

Project: Movement

Part 1: basic_motion

  • Follow along
  • Read comments
  • Caution - Robot might move

Part II: teleoperation

  • Batteries in controller
  • Controller dongle goes into laptop
  • Switch mode
  • Follow along
  • Read comments

Press at the same time to change mode.

Smart Robot Camp

20 of 62

Machine Learning

Day 2 - Afternoon

Smart Robot Camp

21 of 62

Smart Robot Camp

22 of 62

TRADITIONAL PROGRAMMING

Traditional code for “Is this picture a pig?”

if (isPink(picture) and hasTail(picture) and hasPointedEars(picture) and hasFourLegs(picture) and …) � print “Yes!”

else � print “No!”

Rules for

“Is this picture a pig?”

Is it pink?

Does it have a tail?

Pointed ears?

Four legs?

And so on...

Smart Robot Camp

23 of 62

Yes, even in Oak Ridge

?

Smart Robot Camp

24 of 62

HOW DO YOU DECIDE

WHAT THE RULES ARE?

Smart Robot Camp

25 of 62

YOU DON’T!

LET THE COMPUTER DO IT WITH

MACHINE LEARNING!

Smart Robot Camp

26 of 62

MACHINE LEARNING

A machine learning method takes a bunch of data and “learns” from it!

Label: Pig

Label: Not a pig

Label: Pig

Label: Not a pig

Machine

Learning

Method

Machine’s rules for determining whether or not an image is a pig

Data

Smart Robot Camp

27 of 62

WHAT’S THE DIFFERENCE BETWEEN MEMORIZING AND LEARNING?

Smart Robot Camp

28 of 62

DID IT “LEARN” SOMETHING?

Label: Pig

Label: Not a pig

Training Data

The data we give to the machine learning method to learn from

Testing Data

The data we hold out and use to check to see if the method actually learned something!

Label: Pig

Label: Not a pig

Label: Pig

Label: Not a pig

Smart Robot Camp

29 of 62

WHERE IS ML USED?

Smart Robot Camp

30 of 62

WHY DOES IT WORK NOW?

Lots of Data

Powerful Computers

  • 350 million new photos to Facebook every day
  • 300 hours of video uploaded to YouTube every minute
  • 500 million Tweets every day

  • Computers are faster and bigger than ever!

Smart Robot Camp

31 of 62

NEURAL NETWORKS

Smart Robot Camp

32 of 62

NEURAL NETWORK EXPLANATION

30

50

70

2

-1

1

Smart Robot Camp

33 of 62

NEURAL NETWORK EXPLANATION

30

50

70

2

-1

1

30*2

Smart Robot Camp

34 of 62

NEURAL NETWORK EXPLANATION

30

50

70

2

-1

1

30*2 + 50*(-1)

Smart Robot Camp

35 of 62

NEURAL NETWORK EXPLANATION

30

50

70

2

-1

1

30*2 + 50*(-1) +70*1 = 80

80

if number > 0

send number

else

send 0

Smart Robot Camp

36 of 62

NEURAL NETWORK EXPLANATION

-30

30

70

2

-1

1

-30*2 + 30*(-1) +70*1

= -20

0

if number > 0

send number

else

send 0

Smart Robot Camp

37 of 62

NEURAL NETWORK EXPLANATION

-30

30

70

2

-1

1

-30*2 + 30*(-1) +70*1

= -20

0

if number > 0

send number

else

send 0

Weights

Smart Robot Camp

38 of 62

NEURAL NETWORK EXPLANATION

  • “Backpropagation” is used to figure out what all of the weights should be!

  • We start with a random guess, and feed the answer through the network, and see how far away it is from the right answer.

  • Backpropagation uses the “error” to figure out how to change the weights so that the error gets smaller.

Smart Robot Camp

39 of 62

Neural Network Explanation

0.3

0.7

Guessed

Answer

1

0

Correct

Answer

Smart Robot Camp

40 of 62

Neural Network Explanation

0.3

0.7

Guessed

Answer

1

0

Correct

Answer

Update weights to get closer to the correct answer!

Smart Robot Camp

41 of 62

Neural Network Explanation

Run a data example through

Update weights

Keep repeating until your answers on the training set are good enough!

Smart Robot Camp

42 of 62

Human Neural Network Activity

Smart Robot Camp

43 of 62

Smart Robot Camp

44 of 62

WHAT IS ALGORITHMIC BIAS?

Smart Robot Camp

45 of 62

Self-Driving Cars

Smart Robot Camp

46 of 62

Self-Driving Cars

Smart Robot Camp

47 of 62

Self-Driving Cars

Smart Robot Camp

48 of 62

Project:

Obstacle Avoidance

Day 2 - Afternoon

Smart Robot Camp

49 of 62

Collision Avoidance

Smart Robot Camp

50 of 62

Step 1 - Training Data Collection

Smart Robot Camp

51 of 62

Collision Avoidance

Step 2

  • Training the network
  • Copy the data to jupyter.orcsgirls.org
  • Run the training notebook
  • Copy trained network back to robot

Step 3

  • Run live_demo notebook on robot
  • Do not let it fall of the table

Smart Robot Camp

52 of 62

Pair Programming

Two girls

One laptop

One robot

Unstoppable

Smart Robot Camp

53 of 62

Robot Time!

  • Pair up
  • Check the number on your robot
  • Turn on the robot and wait until the IP address shows on the little screen
  • Connect the laptop for the WiFi named ORCSGirls
  • In a web browser visit jetbotX.local:8888 (X is the number of your jetbot)

Make sure you connect to your robot!

Caution - robot will move when running commands in the notebook!

Smart Robot Camp

54 of 62

Project:

Object detection and following

Day 3

Smart Robot Camp

55 of 62

Robot Time!

  • Pair up
  • Check the number on your robot
  • Turn on the robot and wait until the IP address shows on the little screen
  • Connect the laptop for the WiFi named ORCSGirls
  • In a web browser visit jetbotX.local:8888 (X is the number of your jetbot)

Make sure you connect to your robot!

Caution - robot will move when running commands in the notebook!

Smart Robot Camp

56 of 62

Project:

Road following

Day 4

Smart Robot Camp

57 of 62

Step 1 - Training Data Collection

Notebook

data_collection.ipynb

Smart Robot Camp

58 of 62

Road follow

Step 2

  • Training the network
  • Copy the data to jupyter.orcsgirls.org
  • Run the training notebook
  • Copy trained network back to robot

Step 3

  • Run live_demo notebook on robot
  • Keep your robot safe

Smart Robot Camp

59 of 62

Pair Programming

Two girls

One laptop

One robot

Unstoppable

Smart Robot Camp

60 of 62

Robot Time!

  • Pair up
  • Check the number on your robot
  • Turn on the robot and wait until the IP address shows on the little screen
  • Connect the laptop for the WiFi named ORCSGirls
  • In a web browser visit jetbotX.local:8888 (X is the number of your jetbot)

Make sure you connect to your robot!

Caution - robot will move when running commands in the notebook!

Smart Robot Camp

61 of 62

Parent Showcase

Day 4

Smart Robot Camp

62 of 62

THANK YOU SO MUCH FOR ATTENDING

www.orcsgirls.org

contact@orcsgirls.org

Big thank you to our volunteers and sponsors.

ORCSGirls

ORCSGirls

Smart Robot Camp

Smart Robot Camp