33
Figure 14. Internal coordinate system
Be aware that 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 a few meters and one or
two revolutions, 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.
On start-up, the robot is at the origin (0, 0, 0), pointing along the
positive X-axis at 0 degrees. Absolute angles vary between 0
and ±4096 angular units (+180 to -179 degrees).
You may reset the internal coordinates back to 0,0,0 with the
SETO
command #7.
DriftFactor, RevCount, and TicksMM
Three client commands let you change, albeit momentarily for the current client-server connection, those values that
affect translation, rotation and drift in your robot.
TicksMM
is the number of encoder ticks per millimeter tire rotation
for translation speed and distance computations. The default FLASH value can be changed on-the-fly during a client
connection session with the
TICKSMM
client command #93 and unsigned integer value.
DriftFactor
is a signed value in 1/8192 increments that gets added to or subtracted from the left wheel encoder’s
ticks to correct for tire circumference differences and consequent translation and rotation drift.
DriftFactor
defaults
to its FLASH value on start up or reset, and can be changed on-the-fly with the
DRIFTFACTOR
client command #89 with
signed integer argument.
The
RevCount
parameter is the differential number of encoder ticks for a 180-degree rotation of the robot and is used
to compute and execute headings. Like
DriftFactor
and
TicksMM
,
RevCount
defaults to its FLASH value on startup
or reset, and can be changed on-the-fly with the
REVCOUNT
client command #88 and unsigned integer argument.
SONAR
When connected with and opened by the client, ARCOS automatically begins firing your robot’s SONAR, one disc each
simultaneously for each of up to four arrays, as initially sequenced and enabled in your robot’s FLASH parameters. The
SONAR servers also begin sending the SONAR-ranging results to the client via the standard SIP.
Enable/Disabling SONAR
Use the
SONAR
client command #28 to enable or disable all or individual SONAR arrays. Set bit zero of the SONAR
argument to one to enable or zero to disable the array(s) SONAR. Set argument bits one through three to an individual
array number one through four to enable or disable only that array 1-4. Array zero, the form of the original P2OS
command, affects all the arrays at once.
For example, an argument value of one enables all the SONAR arrays, whereas an argument value of six silences array
number three. Monitor the status of the SONAR arrays in the
FLAGS
integer bits 1-4 of the standard SIP. The
respective bit is set if the array is engaged.
Polling Sequence
Each array’s SONAR fire at a rate and in the sequence defined in your robot microcontroller’s FLASH parameters.
(Consult the next chapter on how to change the FLASH settings.) Use the SONAR
POLLING
command #3 to have your
client change the firing sequence, and the
SONAR_CYCLE
command #48 to change the rate. The changes persist until
you restart the client-server connection.