Skip Navigation

Class Sessions and Assignments - Programming Robots

Weeks 10 – 13: OPTION 1

PROGRAMMING ROBOTS (pdf version)

In this module, you will begin to learn about robotics, in particular, mobile robots. You will have a chance to experiment with an actual robot, including various sensors, and you will complete two 2-week projects using it. The assignments and experiments will lead you through some of the steps upon which to build your projects, while exposing you to the interesting (and sometimes unpredictable!) world of robots.

1. MATERIALS & READINGS

Your group was loaned a GoPiGo robot, including an ultrasound sensor (i.e., sonar) and a camera.

There are several tutorials and guides for assembling and programming the robot, many of which are at the GoPiGo website. Links to these and related tutorials, readings and videos for each exercise listed below are contained in the exercise descriptions as listed.

The graded portion of the module consists of two 2-week projects, described below. There are 12 ungraded exercises that you will need to complete to prepare you for completing the projects.

Exercises (pdf version of all exercises)
1.     Assembling your robot
2.    Communicating with and controlling the robot: Raspbian, ssh, and VNC
3.    Exercising your robot
4.    Experiment: Real versus expected movement
5.    Compensating for servo errors
6.    Compensating for movement errors
7.    Building a behavior: approach-or-avoid
8.    Separating concerns: Toward behavior-based control
9.    Object-oriented programming introduction: A robot object
10.  Using the camera
11.   Following an object
12.   A behavior that remembers

2. SCHEDULE & BLOG ASSIGNMENTS

Week 10 Tuesday4/4/17
  • Introduce yourself to your partner for the first 2-week portion of the module.
  • Go over Robot Project 1 on Building a Robotic Insect, which is due a week from Thursday. You will need to do at least Exercises 1–9 in order to accomplish the Project.
  • Explore the GoPiGo website: read about the robot, view the tutorials for assembling and using the robot.
  • Work on assembling your robot and trimming its motors (Exercise 1), obtaining help from the CLA/instructor as needed.
  • Work on communicating with and testing out your robot (Exercise 2).
Week 10 Thursday4/6/17
  • Work on exercises 3-9 in class with CLA/instructor support.
  • Blog Assignment:
    • Go to https://www.ted.com/playlists/17/how_to_live_with_robots Select a minimum of two videos to watch. Name the videos you watched and provide your reflections on those videos.
    • Comment on what worked well this week, what didn’t, and what you learned.
    • Download the Team Project Peer Assessments handout, read it, click the URL at the end of the handout, and rate a minimum of two of your past project partners. We encourage you to rate all four. (Due Sunday evening by 8:00 pm)
Week 11 Tuesday4/11/17
  • Work on exercises 3-9 and project in class with CLA/instructor support.
Week 11 Thursday4/13/17
Week 12 Tuesday
  • Work on remainder of exercises in class with CLA/instructor support.
Week 12 Thursday
  • Work on remainder of exercises and project in class with CLA/instructor support
  • Blog Assignment: (1) Go to https://www.ted.com/playlists/135/will_drones_save_us_or_destroy Select a minimum of two videos to watch. Name the videos you watched and provide your reflections on those videos. (2) Comment on what worked well this week, what didn’t, and what you learned. (Due Sunday evening by 8:00 pm)
Week 13 Tuesday
  • Work on remainder of exercises and project in class with CLA/instructor support
Week 13 Thursday

As with all university courses, you should expect to spend 2 to 3 hours outside of class for every hour you spend in class.

3. TWO-WEEK PROJECT ASSIGNMENTS

Robot Team Project Assignment 1 (due at end of Week 11) – Build a Robotic Insect (pdf version)

In this project, you will write a program to make your robot behave like an insect, such as a cockroach, in a rather simplistic fashion. Your robot will wander around an area, investigating interesting things it “sees” (using its ultrasonic sensor) and running away from approaching objects. The program will be a simple behavior-based controller. You will write several behaviors, implemented as functions that will be called by the controller. Different behaviors will be responsible for different aspects of how the robot responds to its environment: wandering, avoiding an object that is approaching, etc. (More information is available at the module’s webpage.)

Doing exercises 1–9 will prepare you for doing this project; in fact, some of the behaviors may be usable for the project with little or no change. The behaviors that your project should have are:

1.    Avoid obstacle: when moving toward an object, stop, then turn and go around it
2.    Wander: the robot will wander about the area
3.    Investigate: when a stationary object is within some distance , and closer than the background, then go toward it.
4.    When a stationary object is in front of the robot at some other distance , stop and scan it with the sonar to determine how big it is.
5.    Turn and run: if the robot perceives something coming toward it, then it should turn and run for some distance in a direction that takes it away from the object; then it should turn back to where it was going to see if it’s being followed. If so, then it should run away again.

Each of these will have access to the robot’s percepts—its sensor data—and each will independently produce a description of the actions it thinks the robot should take in response. Both the percept format and the command format are described in Exercise 9, along with how to interface your controller to the robot using a robot interface that will be provided.

Your controller will call each of the robot’s behaviors, collecting their action recommendations. It will then use a subsumption controller to decide which behavior’s recommended actions are actually taken by the robot. This has the property that more important (in the current context) behaviors are favored over less important ones.

You will be provided with an interface to the robot that helps with the above tasks.

Grading: You will demonstrate your robot’s behavior in class, and you will submit a short report about the project and a video of your robot in action. Late project submissions result in lowering of full grade per week.

Rubric

Grade Performance
A Robot performs all behaviors satisfactorily and subsumption controller works correctly.
B Robot performs most behaviors satisfactorily and subsumption controller works correctly.
C Robot performs most behaviors satisfactorily and subsumption controller works mostly correctly.
D Robot performs some behaviors satisfactorily and subsumption controller works somewhat correctly.
F A project meeting the above minimum criteria was not turned in within two weeks of the deadline.

Robot Team Project Assignment 2 (due at end of Week 13) – Robo Challenge Choice (pdf version)

For the second two-week project, choose one of the following projects and implement it using the GoPiGo. You should build on what you did in Project 1 and in the exercises. Additional information about the projects is available on the module’s webpage.

Surveillance Bot

Make the GoPiGo into a surveillance bot. The robot will either patrol an area and, when it sees something unusual, approach and take a picture of it; or it will lurk where it has a good view of an area, then when it sees something unusual, approach and take a picture.

Robopet
Turn your GoPiGo into a robotic pet. You will build on the behaviors developed in the exercises and Project 1, adding additional ones to imitate pet-like behaviors. For example, if you were to make a robocat, you might add behaviors to have the robot rub up against your leg, chase prey (e.g., a ball, or the spot of a laser pointer), etc. (Note: just having the robot do nothing, or ignore you, and calling it a robocat, isn’t sufficient!) A robodog might do tricks (e.g., based on seeing a particular color via the camera, or the sonar detecting the left-to-right motion of an object, etc.), come when called (when you use a color or wave an object, e.g.), or play fetch.

Mazerunner
Have your robot navigate a maze. You will need to make the walls of the maze out of something the sonar can “see” easily. You will build a maze, then have the robot either find a goal in the center or find its way through/out of the maze. You should build on the behavior-based controller from Project 1 and the exercises. You will need to add behaviors, for example, to remember where the robot has been, to choose which direction to go when presented with a choice, etc. You may also need to modify existing behaviors (e.g., so that the robot can approach a wall more closely or not run away, etc.).

Dribbling
Have the Gopigo dribble a soccer ball (or a smaller ball, perhaps) down the “field” and through a “goal”. The goal can just be two boxes arranged with a gap between them. The robot will need to be able to locate the ball (e.g., by color or with its sonar), go to it, and move it toward and through the goal, chasing it down as necessary if it gets away. You can modify the robot so that it can more easily dribble the ball, for example, by taping cardboard or wooden “arms” to it, etc.

Robosoccer
This project is a more advanced version of project option dribbling. Here, you will set up two goals and pit your robot against another group’s robot in a game of one-on-one soccer.

Alternative Robot Controller
Explore alternate kinds of robot controllers. At minimum, you will implement a vector field-based controller (sometimes called a potential field-based controller) and compare it to the behavior-based controller you built in Project 1.

Grading:

A brief write-up, a demonstration, and a video of the robot in action are required. Late project submissions result in lowering of full grade per week.

Rubric

Grade Performance
A The project was well-designed and implemented and the code was documented and well-written
B The project was well-designed and implemented with at most minor problems; the code was mostly well-documented and well-written.
C The project design and implementation may have had some minor problems but few major ones; the code was documented and acceptably-written.
D The project design and/or implementation had some major flaws; the code was sparsely documented or not documented at all, and may have been poorly-written.
F A project meeting the above minimum criteria was not turned in within two weeks of the deadline.

 


Creative Commons License
COS 120 Introduction to Programming by School of Computing and Information Science is licensed under a Creative Commons Attribution 4.0 International License.


Back to Class Sessions and Assignments