Archive for March 6th, 2006

This is an updated version of the RoombaComm API.

This release contains Javadoc documentation!

This release further expands on the two different levels of driving API: a lower-level one that is based on velocity, and a higher-level distance/angle one. I’m debating how to notate these differences. For instance:

roombacomm.setSpeed( 100 ); // set speed to 100 mm/sec
roombacomm.goForward( 150 ); // go forward 150 mm
roombacomm.spinRight( 45 ); // spin 45 degrees right
roombacomm.goBackward( 25 ); // go 20 mm backward

vs.

roombacomm.goForwardAt(100); // go forward at 100mm/sec
roombacomm.pause( 1500 ); // wait for 1.5 seconds, so it goes 150 mm
roombacomm.spinRightAt( 100 ); // spin right at 100mm/sec
float ptime = 45.0 * roombacomm.millimetersPerDegree / 100.0;
roombacomm.pause( ptime ); // wait until the Roomba has spun thru the angle

The wacky angle calculation above is the primary reason why I wanted a higher-level API. I want to do more Logo-like things.