Simple commands

Try this first command in your telnet session :

ledPlay;
[00000476:notag] 0.000000

The first line asks for the value of the play button led. The second is the answer from the iRobot engine. The first integer value is a timestamp for the answer (in miliseconds from the engine startup). It is followed by a tag. Please refer to the URBI tutorial for mode details. What is important here is the floating point value ending the line. It is the value stored in the led object. Here 0.000000 indicates the led is switched off. Setting a value of 1 will switch the led on.

Do not forget the ';' at the end of the commands. The URBI server will wait indefinitely for the command to wait if omitted.

The next commands will introduce the +end feature. Enclosing you commands in +end:{...};. Will make the engine warn you when a command comes to an end.

Try the following :

+end:{wheels = 100 time:2s | sleep (2s) | wheels = 0;};
[00002622:notag] *** end

wheels is a device groupe for the left and right wheels of the robot. Your robot should speed up to 100 mm/s in 2 seconds, and then go forward maintaining this speed for 2 mode seconds. The robot then stops.

You may now try to make it come back to its initial position with a similar command.

Next, try this :

+end:{wheelL = -150 & wheelR = 150 | sleep (2s) | wheels = 0;};
[00005095:notag] *** end

Your robot should turn on itself for 2 seconds. This command tells the robot to set both its wheels speed at the same time, and then to wait for 2 seconds before full stop.

The last simple command will be :

bumpRDetect:at (bumperR != 0) echo "Collision on right side";

Now try to put press the front right of your iRobot. You should get a message like :

[00008215:notag] *** Collision on right side

The at keyword allows you to detect events and make your iRobot Create act accordingly. The bumpRDetect: is called a tag. It is used to give a name, or an identifier to a command. You can use special commands like stop, freeze and unfreeze to manipulate running commands. Try freeze bumpRDetect;. The previous message should not be printed anymore when bumper is pressed. The same command with unfreeze will bring it back on.

You should now be able to play with the iRobot URBI engine. The next chapters will give you complete details about the engine, but what we saw here is enough to get used with the iRobot and URBI.

Once again, you can get complete URBI tutorial there tutorial.