Page 40
iRobot Create KIPR Link Library Functions
There are a large number of functions in the KIPR Link Library for controlling an iRobot Create module.
These functions provide an interface between a program on the KIPR Link and the Create Open Interface
(
http://www.irobot.com/filelibrary/pdfs/hrd/create/Create%20Open%20Interface_v2.pdf
). The
functions which update sensor data, and the connection functions return the requested information if
they are successful and return a number greater than 100,000 if there is some error. If an error is
returned, the error message is 100,000 + <Create-Serial-Interface-Packet-Number>. For example, a code
of 100,007 indicates an error when requesting bumper or wheel drop sensor status.
The functions for moving the iRobot Create are non-blocking, excepting scripts which once started play
to completion. Movement commands (with the exception of
create_stop
) are sent to the iRobot Create
only if they represent a change from the previous movement command. For this reason, movement
commands may be placed in tight loops without concern of overwhelming the serial connection. The
iRobot Create's trajectory will continue until a different movement command is given.
The iRobot Create may also be used to play MIDI music. Up to sixteen 16 note songs may be loaded into
the iRobot Create. See the Create Open Interface manual for details on note and duration codes.
These are the commonly used functions, for a complete list, see the appendices.
create_connect()
Connects the KIPR Link serial interface to the iRobot Create. Call this function first. By default
the iRobot Create will be in “safe mode”.
create_disconnect()
Disconnects the KIPR Link from the iRobot Create by reverting the serial interface to USB. Call
this function at the end of the program, otherwise the KIPR Link will remain connected to the
iRobot Create and the KISS IDE will not be able to communicate with your KIPR Link. This
function also shuts off the Create motors. Power cycling your KIPR link will also revert the serial
interface to USB.
create_stop()
Stops the drive wheels.
create_drive(
<
speed
>
,
<
radius
>
)
Drives in an arc at a set speed. Speed range is 20-500mm/s, radius is in mm.
Содержание KIPR Link
Страница 1: ...KIPR Link Manual Version BB2014 1 1...