AmigoBot Mobile Robots
29
Note that you may override deceleration with the emergency stop (E_STOP) command
number 55. Accordingly, with E_STOP, the robot brakes to zero translational and
rotational velocities with very high deceleration and remains stopped until it receives a
subsequent translational or rotational velocity command from the client.
Position Integration
AmigoBot keeps track of its position and orientation based on dead-reckoning from
wheel motion, which is an
internal coordinate position
.
Registration between external
and internal coordinates deteriorates rapidly with movement, due to gearbox play,
wheel imbalance and slippage, and many other real-world factors. You can rely on the
dead-reckoning ability of the robot for just a short range—on the order of several meters
and one revolution, depending on the surface (carpets tend to be worse than hard
floors).
Also, moving either too fast or too slow tends to exacerbate the absolute position errors.
Accordingly, consider the robot’s dead-reckoning capability as a means of tying
together sensor readings taken over a short period of time, not as a method of keeping
the robot on course with respect to a global map.
The orientation commands
HEAD
and
DHEAD
turn the robot with respect to its internal
dead-reckoned angle. On start-up, the robot is at the origin (0,0), pointing toward the
positive x-axis at 0 degrees. Absolute angles vary between 0 and 360 degrees. As the
robot moves, it will update this internal position based on dead-reckoning.
You may reset the internal coordinates to 0,0,0 with the SETO AmigOS command.
Sonars
When connected and opened, the AmigOS sonar server begins firing AmigoBot’s sonar
in the predefined default sequence clockwise beginning with the sonar closest to the left
wheel (sonar #0). AmigOS also begins sending the sonar ranging results to the client via
the server-information packet. Use the SONAR command to enable (argument is "1") or
disable (argument is "0") the sonar pinging.
For example:
sfRobotComInt(sfCOMSONAR,0); /* Stop the pinging when not needed */
Use the
POLLING
command to change the polling sequence of the sonars. Its argument is
a null-terminated string of up to 15 sonar numbers (sonar 1) in octal notation
\001 through \010.
For example,
sfRobotComStr(sfCOMPOLLING,"\001\002\001\002\000");
causes only the left front sonars to ping. Note that if the string is empty, all sonars get
turned off, even though you hadn't disabled the sonar with the SONARS command.
Input / Output (I/O)
Your AmigoBot comes with a number of I/O ports that you may use for some of its
accessories and for your own custom attachments. See Appendix A,
Ports and
Connections
for port locations on the AmigoBot microcontroller. The various port states
and reading appear in the SIP and may be manipulated with AmigOS client commands.
Currently, only the analog ports are implemented in software.