You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let $s_1$ be the encoder on the inside of the turn, $s_2$ be the encoder on the outside of the turn, $r$ be the radius of the turn, and $w$ be the width of the robot (between the wheels).
Then, the definition of a radian can be rewritten as:
$ds_1 = r d \theta$
$ds_2 = (r + w) d \theta$
Both of those equations can then be solved for $r$, giving:
$r_1 = {ds_1 \over d \theta}$
$r_2 = {ds_2 \over d \theta} - w$
And they can be averaged to get:
$\bar r = { { { { \Delta s_1 + \Delta s_2 } \over { d \theta } } - w } \over 2 }$
Let $\bar x$ be the center of mass along the x-axis, then the radius of the robot's arc would be:
$r + w \bar x$
Using a unit circle, it can be them seen that:
$dx = ( \bar r + w \bar x ) \text {versin} ( d \theta )$
$dy = ( \bar r + w \bar x ) \sin ( d \theta )$
After substituting in $\bar r$ and approximating the differentials,
$\Delta x = \Big ( { { { { \Delta s_1 + \Delta s_2} \over { \Delta \theta } } - w } \over 2 } + w \bar x \Big ) \text {versin} ( \Delta \theta )$
$\Delta y = \Big ( { { { { \Delta s_1 + \Delta s_2} \over { \Delta \theta } } - w } \over 2 } + w \bar x \Big ) \sin ( \Delta \theta )$
However, this assumes that the robot is always at $(0, 0)$ facing the positive y-axis.
To account for this, we do a polar basis transformation, to get: