University of Rochester

Rochester Review
November-December 2009
Vol. 72, No. 2

Review home


In Review

Computer Science Taking Your Robot to Class A hands-on programming course aims to make learning to program fun by using robots. By Kathleen McGarvey
students ROBOTIC DANCE: Students in the course, such as Chelsea Flint ’12 (right) with course teaching assistant Katie Lang, learn to program small, wheeled robots to draw, dance, and do other maneuvers. (Photo: Elizabeth Lamark)

“Computer science can be hard when you’ve never done anything like it before,” says Hans Koomen ’89 (PhD), an adjunct associate professor of computer science. “It’s all about problem solving. And problem solving with a computer isn’t easy.”

One remedy, he says, is to make the problems more tangible. And that’s precisely what happens in the course Explorations in Robotics, where students learn to program small, wheeled robots to complete a set of basic tasks such as drawing shapes and maneuvering through mazes.

“It’s a more concrete way of getting the idea of programming,” Koomen says. “Plus, robots are fun.”

Intended for freshmen—“students who don’t have much experience with computer science but are intrigued,” Koomen says—the class meets twice a week, once for a lecture and again for a lab. This fall was only the second time the course, which is modeled on a curriculum developed at Bryn Mawr and Georgia Tech, had been offered at Rochester.

As students gather in a Hylan Building lab late one autumn afternoon, Koomen asks for a volunteer. Brian Taub ’11, from Buenos Aires, steps forward, putting on the blindfold Koomen hands him.

“Take two steps backward,” Koomen instructs, “and drop to your knees.”

Taub does, albeit tentatively. Koomen hands him a dry erase pen, and asks him to draw a one-foot-by-one-foot square on the large, white floor mat before him.

The resulting shape is askew, its angles off—but it is recognizably a square.

“This is what you want your robots to do,” Koomen tells the students. “So far, our little robots are essentially blindfolded,” lacking at this stage any way of gathering information visually. “Don’t get frustrated with your robot. It doesn’t have much feedback.”

The students set to work at their laptops, challenged by Koomen to write functions that will move the robot a given distance or turn it a given number of degrees, and then combine these to get the robot to draw a square with its attached pen.

“The robot has no way of telling how far it has gone, only how long it has been going, so the students calibrate the distance it goes or the angle it turns in a certain time. This allows them to issue the correctly timed commands to complete the square,” Koomen explains.

Standing on three wheels, two of them motorized, the robots are low to the ground with round, dusky blue bodies about 10 inches in diameter. The machines give a friendly whirr as they move across the floor as students watch and measure. Using Python, a relatively new programming language with a simple syntax, the students refine their calculations based on what they see.

Laurel Stewart ’10, an English major from Seattle, took computer classes throughout her schooling before coming to Rochester and says that as a result, programming feels like it comes to her “more naturally than people who didn’t get that.”

She calls the course “hands-on, and more intimate” than many computer programming courses, where students often learn solely through lecture and out-of-class assignments.

Students borrow the robots from the department but keep the machines with them, playing and experimenting with the devices as often as they like over the course of the semester. As a result, Koomen says, students “definitely identify with the robots.”

With an add-on electronics card that provides a camera and Bluetooth wireless, the robots have different modes of sensing. Koomen begins the course by teaching students how to give motion commands, which allows the students to teach their robots to do things like dance and draw. Then they learn how to use the built-in light and infrared sensors to control and guide their robots’ motion and help the devices to avoid obstacles.

Eventually, students make use of the robots’ camera and other sensors to teach the machines how to follow them around, find brightly colored objects, and negotiate a maze.

“The idea of composition is an important part of computer programming, but the robot makes that fairly intuitive,” says Koomen. “You perform some smaller tasks in combination to accomplish bigger tasks.”

“You get to see the results right away,” says Chelsea Flint ’12, of Fairport, N.Y., who is thinking of becoming a computer science major, perhaps with a concentration in robotics. “It’s based more on the application of programming rather than the theory.”

“Computer science is both an art and a science,” Koomen says. “There’s a fair bit of scientific rigor needed to write successful programs, but there’s also creativity and art in how you solve problems. “It takes an understanding of the rules of programming, and you have to think logically because the computer’s only capable of logic. The computer forces you to be precise, and students are often used to less formality than that. The robots can help the students by making the effect of incorrect instructions visible.”

Trying to complete the assigned tasks “really makes you think about whatever action you’re trying to get your robot to do,” says Flint. “You have to break it into minute steps. There are so many things we do automatically, and robots don’t do that.”

The course may blend science and artistry—but also in the mix, Flint suggests, is the sheer, absorbing pleasure of grappling with a good puzzle.

“Sometimes I look up from working with my robot, and I’ll realize class ended 10 minutes ago,” Flint says, “and we’re all still there.”