Top Banner
Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009
29

Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

Dec 25, 2015

Download

Documents

Domenic Goodman
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

Introduction to the course

Computer Programming through Robotics

CPST 410

Summer 2009

Page 2: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 2

Contact

Prof. Harry Howardhoward at tulane dot edu 862-3417 (voice mail 24 hours a day)Newcomb Hall 322-D Office hours: right before class & by appointment

(the link goes to my home page, which displays my Google calendar)

Course home page (http://robolab.tulane.edu/CPST410/)

Page 3: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 3

Show of hands

Who are the beginners?Who are the continuing students?You can do both.

Page 4: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 4

Goals - beginners

The goal of this course is to introduce you to the principles of computer programming by programming a small mobile robot.

We use the Lego Mindstorms NXT robot, v. 1.1.

This course will gravitate towards my interests in linguistics and cognitive science.

Page 5: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 5

Goals - beginners, cont.

However, it is an introduction and does not require any knowledge of computer programming, robotics, cognitive science, or linguistics.

It satisfies the formal discipline requirements for the Cognitive Studies (CGST) major.

Page 6: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 6

Objectives

For you to demonstrate your understanding of computer programming, you will perform the following tasks:turn in a daily project,turn in a final project by the final-exam day,perhaps come to class.

Page 7: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 7

Objectives: weekly project

Turn in a project every day except the first & secondNo project can be accepted late10 * 7.5% = 75%

Even though these look like a lot of small grades

Page 8: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 8

Objectives: final project

Turn in a final project by the final exam day (Aug 10). This may be a group effort, but the entire group will receive the same grade. [25%]

Page 9: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 9

Objectives: class participation

Note that there is no credit for class participation.I will post my PowerPoint presentation to the class

website after each class (my presentations are ugly so that you can print them easily).

I am recording myself and will post an mp3 (i.e. podcast) to the class website after each class.

So you don't have to come to class, if you can turn in the daily project somehow.

In any event, I will change any high X– into a Y+ if I notice you participating in class

Page 10: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 10

Code of Academic Integrity

“The integrity of Newcomb-Tulane College is based on the absolute honesty of the entire community in all academic endeavors. As part of the Tulane University community, students have certain responsibilities regarding work that forms the basis for the evaluation of their academic achievement. Students are expected to be familiar with these responsibilities at all times. No member of the university community should tolerate any form of academic dishonesty, because the scholarly community of the university depends on the willingness of both instructors and students to uphold the Code of Academic Conduct. When a violation of the Code of Academic Conduct is observed it is the duty of every member of the academic community who has evidence of the violation to take action. Students should take steps to uphold the code by reporting any suspected offense to the instructor or the associate dean of the college. Students should under no circumstances tolerate any form of academic dishonesty.”

For further information, point your browser at http://college.tulane.edu/honorcode.htm.

Page 11: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 11

Students with disabilities

Students with disabilities who need academic accommodation should:Contact and register with the Office of Disability

Services (ODS). For more information, visit the ODS website at http://erc.tulane.edu/disability/.

Bring official notice to me from the ODS indicating that you need academic accommodation. This should be done before the first project.

Page 12: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 12

Readings

TextbooksBeginners:

LEGO Mindstorms NXT-G Programming Guide by James Floyd Kelly (~$17)

LEGO Mindstorms NXT Power Programming: Robotics in C by John C. Hansen (~$22)

Page 13: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 13

Schedule of assignments

See handout or website for details of the schedule.Any changes to the schedule will be made to the

website. I have never taught on this schedule before, so I

do not know whether the syllabus is too fast or too slow. We will figure that out as we go.

Page 14: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 14

Odds and ends

We will cover 30-40 pages a day, though Hansen's book is much denser than Kelly's

Page 15: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 15

Continuing students

GoalsTo practice and expand on what you know

Objectives: Turn in a final project by the final exam day

(May 6). This may be a group effort, but the entire group will receive the same grade. [100%]

Page 16: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 16

Special for today

If you prefer to use an e-mail address other than your Tulane one, please e-mail me a message to that effect.

Page 17: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 17

Go over roster

And pass around sign-up sheet & camera.

Page 18: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

Robots and programs

Kelly §1

Page 19: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 19

What is a robot?

Kelly's definition A robot is a device that is built to INDEPENDENTLY perform

actions and interact with its surroundings. (p.1)

More generally, such things are divided into autonomous robots non-autonomous or remote-controlled robots

Autonomy is much more interesting and is what we are interested in

Page 20: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 20

What is a program?

Kelly's definitionA program is a set of instructions for a robot.Programming is what you do when you create

a program.

Robots, and computers in general, are DUMB!Their instructions have to be extremely explicit

Page 21: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 21

The MINDSTORMS NXT application

The MINDSTORMS NXT application is the tool that you will use to create instructions for your robot Version 1.1 is the most recent The CDs that came with the boxes are v. 1

There are two flavors, the regular one (in the big cardboard boxes), and the educational one (in the plastic bins).

I want you to all install the educational flavor, which has the Robot Educator

Page 22: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 22

NXT-G

NXT-G is the programming language that the MINDSTORMS NXT application uses

Like I said the first day, it is a graphical language, which means that you build a program by inserting icons and moving them around

Most other languages are based on text, like the (not quite) C language we will use later on

Page 23: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

Program structure

Kelly §2

Page 24: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 24

Pseudo code

Before writing a program in the way that the robot understands, we will sketch what we want it to do in a way that people understand

Kelly calls this a 'fake program' but the technical term is pseudo-code.

Page 25: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 25

One example of pseudo-code

SPOT, move forward about 10 inches, turn left 90 degrees, and start moving forward, then start looking for a black object with your ultrasonic sensor, because I want you to stop when you find a black object, then turn right 90 degrees, and move backward 2 feet, OK? (Kelly, p. 8)

What is good or bad about this example

Page 26: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 26

A different phrasing of the pseudo-code example

SPOT, move forward about 10 inches and stop Now turn left 90 degrees Start moving forward, and turn on your ultrasonic sensor, Stop when you find a black object Turn right 90 degrees and stop. Move backward 2 feet and stop.

What is good or bad about this example?

Page 27: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 27

Pseudo and real code

The main advantage of the second phrasing is that we can match up the commands in each line to elements in the programming language

In NXT-G, these elements are called blocks.

Page 28: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 28

Test the robot!

Put in 6 batteries and see whether it starts up

Play with right and left buttonsTo shut down

Go back to 'My files'Press dark grey buttonPress orange button for check mark

Page 29: Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.

6/29/09 Harry Howard, CPST 410, Tulane University 29

Next time

Finish TribotNXT introductionMovement, 'Going the Distance' Kelly §1-4, 24Bring your laptops!