5.3. Tracking the Robot Pose

Pose Equations

For each motor:

\Delta tick = tick - old\_tick

D = 2\,\pi\,R\frac{\Delta tick}{N}

To update the pose:

d_{center} = \frac{d_{left} + d_{right}}{2}

\phi = \frac{d_{right} - d_{left}}{L}

\mathcal{P}_{i+1} = \left[ \begin{array}{c}
X_i \\ Y_i \\ \theta_i \end{array} \right]
 + \left[ \begin{array}{c}
 d_{center}\,\cos \theta_i\\
 d_{center}\,\sin \theta_i\\
 \phi
 \end{array} \right]

5.3.1. Two Frames of Reference

One of the gotchas of robotics is keeping track of which frame of reference is being used. The global coordinate frame is relative to the robot’s surrounding. We start robotics experiments with the robot at position (0, 0) and facing in the direction of the X axis (\theta = 0). The local coordinate frame is relative to the robot. We use the local coordinates when measuring the movement or setting the velocity of the wheels.

../../_images/kinematic1.png

5.3.2. The Robot’s Global Position

We call the robot’s location and orientation in the global coordinate frame the position, or pose, of the robot. The robot’s position is represented as a vector (\mathcal{P}) containing its x and y Cartesian coordinate pair and its angle of orientation (\theta).

\mathcal{P} = \left[ \begin{array}{c}
x \\ y \\ \theta
\end{array} \right]