.. _mobilePose: Tracking the Robot Pose =========================== .. topic:: Pose Equations For each motor: .. math:: \Delta tick = tick - old\_tick .. math:: D = 2\,\pi\,R\frac{\Delta tick}{N} To update the pose: .. math:: d_{center} = \frac{d_{left} + d_{right}}{2} .. math:: \phi = \frac{d_{right} - d_{left}}{L} .. math:: \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] 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 :math:`X` axis (:math:`\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. .. figure:: kinematic1.png :align: center .. _poseDef: The Robot's Global Position ------------------------------- .. index:: pose, global coordinate 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 (:math:`\mathcal{P}`) containing its :math:`x` and :math:`y` Cartesian coordinate pair and its angle of orientation (:math:`\theta`). .. math:: \mathcal{P} = \left[ \begin{array}{c} x \\ y \\ \theta \end{array} \right] .. toctree:: :maxdepth: 2 encoders odometry