ER1 User Guide 10-11
Events Command
Events Command
Format:
events
The events command allows the robot to send back information from its sensors (if
enabled) as well as sound and move completion notices.
The command is acknowledged with an
OK message, then events are sent as they happen.
Events are terminated by the receipt of any command, even a blank line. It is
recommended that a blank line be used to terminate the sending of events because
otherwise a programmer may confuse an event message for a status return from a
command being issued.
In other words, the user should:
1. Issue the events command
2. Look for the OK
3. Parse the event messages as they come down
4. Then, when ready to act on one of the events, send a blank line and wait for the OK
from that.
5. Event messages will be turned off, though they may still accumulate.
The issuing of new
move and play commands clear any pending completion messages
from the corresponding command. That makes it easy to see that a message is from the
most recently issued command. Also, only the most recent sound level event is kept.
Here are examples of event messages.
speech hello
sound level 8
sound level 24
object spot new (23%) (117,16,19.876 Inches)
move done
play done
play error Sound file c:\fubar.txt not found or don't know
how to play it
move error Cannot connect to the robot hardware.
Here is what happens when the robot recognizes an object:
object <ānameā> <features matched> \
<
total features> <x> <y> <distance in cm>
The object name is always surrounded by double quotes. The distance is always in
centimeters and has one decimal place.