CSC 161 Grinnell College Fall, 2011
Imperative Problem Solving and Data Structures

Scribbler 2 Motion

The Robot

The Scribbler 2 robot has three wheels. The small wheel below the fluke dongle is purely for balance. The two large wheels each have their own motor, which can be adjusted to move at separate speeds to turn the robot to the left or right. The speed of the motors ranges from -1 (backwards at full speed) to 1 (forwards at full speed). It is important to note that there is no built-in time limit for how long the motor can run, so if you call a command to move without specifying a time limit or commanding the robot to stop, the motors will keep running until the Scribbler 2 battery dies.

A second important feature of the Scribbler 2 robot is that it can have the "front" set as either direction. When the robot has it's forwardness set as "scribbler-forward", the front of the robot is the direction without a wheel. When the forwardness is "fluke-forward", the front is the direction with the small wheel (below the green card-like fluke dongle). The command to change the forwardness of the robot is:

rSetForwardnessTxt(char * direction);

and the options are "scribbler-forward" or "fluke-forward". By default, you should have any program incorporating motion set the forwardness to "fluke-forward".

Robot Commands

Timed Commands

Timed motion commands are commands that include time as a variable, so the robot performs the motion for the specified time. These commands are blocking; that is, while the Scribbler 2 is performing these commands, it cannot perform other actions (such as beeping). Also, remember that speed ranges from 0 (no movement) to 1 (full speed), and the unit of time is seconds.

Continuous Commands

Continuous commands are commands that do not include time as a variable. The robot executes these commands until a command to stop is issued. These commands are non-blocking; that is, while the Scribbler 2 is performing these commands, it can perform other actions (such as beeping).

Can you think of a way to calculate the size of a circle, based on the rotation and tranlation speed of the robot, or how to get the robot to turn at a specific angle?

Stop Commands

These commands stop the continuous commands after they have been issued.

This document is available on the World Wide Web as

Created 20 July 2011 by April O'Neill
Last revised 27 July 2011 by April O'Neill
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at