ActivMedia Robotics
for negative integers; see below). The argument is an integer, a string, or nothing, depending on the command.
Saphira Client Command Support
Saphira, as well as ARIA, all support P2OS client commands with useful library functions. You can find prototypes in $(SAPHIRA)/handler/include/saphira.h and saphira.pro. Saphira’s P2OS command names have the prefix sfCOM. Not all P2OS command names are supported in Saphira. See the Saphira Software Manual.
For example, to enable the motors from the Colbert interaction window in the Saphira client GUI, type:
sfRobotComInt(sfCOMENABLE,1);
Or to have your Pioneer 2 play a tune (albeit rather tinny), type:
sfRobotComStrn(sfCOMSAY,"\1\6\2\105",4);
Programming P2OS
You may create your own P2OS interface, or use the convenience functions available through the various
Establishing a Client-Server Connection—SYNC
Before exerting any control, a client application must first establish a connection to the robot server via the Host
When first started, P2OS is in a special wait (“noconn”) state, listening for communication packets to establish a
When in wait mode, P2OS echoes packets back to the client. The client should listen for the returned packets and only issue the next synchronization packet after it has received the appropriate echo.
Autoconfiguration
P2OS automatically sends
The Pioneer class string is simply Pioneer; the subclass depends on your robot model; P2DX or P2AT, for example. Clients may use these identifying parameters to self- configure their own operating parameters. ARIA, for instance, loads the robot’s related parameters file found in a special robot params directory.
Opening the Servers—OPEN
Once you’ve established a communication link, the client should send the OPEN command to the server, which causes the ActivMedia robot controller to perform a few
35