|
[DPRG] Simplified robot navigation calibrating and tuning:
corrections
Subject: [DPRG] Simplified robot navigation calibrating and tuning:
corrections
From: David
dpa at io.isem.smu.edu
Date: Fri May 23 23:10:57 CDT 2008
Howdy,
Steve and Robert wrote:
>>> <dpa at io.isem.smu.edu> wrote:
>>> Sorry for the confusion and general sloppiness on
>>> my part.
>
>> I'm sure most people would agree that your "sloppy"
>> & "confused" information
>> is still very helpful and accurate. I won't even
>> compare it to other info
>> posted on the web. :)
>
> McCoy: No, Spock. He means that he feels safer about
> your guesses than most other people's facts.
Thanks, guys!
I have noticed in the past that I can proof read something
ten times and never see an obvious error, but as soon as I
hit send,,, they leap off of the screen. It's like my brain
is trained to see what I think I wrote right up to the time
it's too late, and then I'm released from the spell and get
to see what I actually wrote. Strange...
Here is an updated version of the basic odometry code as
previously posted here:
<http://geology.heroy.smu.edu/~dpa-www/robo/challenge/math.html>
to include the mods required for corrections of wheel size
errors. This version includes a couple of other refinements,
including clipping the robot's heading calculation to prevent
windup.
------------------------------------------------------------------
Update: Odometry calculations with wheel size error and windup
corrections as referenced in "Simplified Navigation Calibration
and Tuning:"
a. calculate distance for each wheel
left_inches = (float)left_encoder / LEFT_COUNTS_PER_INCH;
right_inches = (float)right_encoder / RIGHT_COUNTS_PER_INCH;
distance = (left_inches + right_inches) / 2.0;
b. accumulate heading and clip to +- 360 degrees
theta += (left_inches - right_inches) / WHEEL_BASE;
theta -= (float)((int)(theta/TWOPI))*TWOPI;
c. accumulate location in X and Y
X += distance * sin(theta);
Y += distance * cos(theta);
This version of the odometry function uses a separate counts per
inch constant for each wheel to allow for tuning out minor
differences in wheel size, and to allow WHEEL_BASE to be specified
in conventional units. It also clips the theta value to a single
360 degree range to prevent theta from "winding up" in the course
of complex maneuvers.
------------------------------------------------------------------
cheers,
dpa
More information about the DPRG mailing list
|