ActivMedia Robotics
example. You may repeat a sonar number and have it ping more than once per
sequence.
For example:
sfRobotComStrn(sfCOMPOLLING,"\001\002\001\002",4); /* ping front left only */
Note that if the string is empty, the sonar get turned off, even though you hadn't disabled
the sonar with the SONAR command.
BUMP_STALL
Because the robots are programmed to climb, it can take up to a second or more to
detect object collisions and subsequent motor stalls. With P2OS version 1.5, we
introduced a responsive way to stop your robot within a few milliseconds upon collision
with an obstacle: BUMP_STALL. With the robot equipped with forward and/or rear
bumpers, you can now program P2OS to immediately stop the robot and notify the client
of a stall if any one of the forward or rear bump sensors get triggered.
NOTICE
BUMPSTALL requires supporting bump ring accessories.
Send the BUMP_STALL command (#44) with a integer argument of 0 to disable the
behavior (default on startup). Use the argument value 1 to enable BUMP_STALL only
when a forward bump sensor gets triggered; 2 for rear-only BUMP_STALL; or 3 for both
rear and forward bump ring-activated stalls.
For example, to enable BUMP_STALL when any one of the five contact sensors on a
forward bump ring gets triggered:
sfRobotComInt(44,1);
E_STOP and E_STALL
In an emergency, your client may want the robot to stop quickly, not subject to normal
deceleration. In that case, send the E_STOP command (#55).
Like BUMP_STALL, use P2OS’ built-in E_STALL feature (version 1_E or later) to simulate a
stall when someone presses the Performance PeopleBot’s Emergency STOP button. An
integrated switch in the button causes the User I/O analog port #4 on the microcontroller
to go high (+5VDC) and thereby notify P2OS of the emergency condition. Accordingly,
when enabled, E_STALL will disable the motors in P2OS and notify your Saphira or other
software client that the robot has stalled (stall bytes in the standard SIP), thereby
avoiding the motor rush that may occur when you reactivate the emergency STOP
button.
Since it is normally disabled, you must enable E_STALL through software at least once
after a reset or power cycle of the Performance PeopleBot. To enable E_STALL, send
the E_STALL P2OS command (#56) with argument = 1; 0 disables E_STALL.
For example, with Saphira:
sfRobotComInt(56,1); /* Enable E_STALL */
sfRobotComInt(56,0); /* Disable E_STALL */
You may also monitor the state of the Emergency STOP button with or without E_STALL as
an analog value reported in the standard SIP. You must first request that the value be
included in the standard packet since it is not the default analog port. (The current
analog port# is encoded in the timer entry.)
39