Page 142 - Designing Autonomous Mobile Robots : Inside the Mindo f an Intellegent Machine
P. 142

Live Reckoning

               For a platform operating on a flat surface, the vector calculation is:
                                     x = x + (D * sine (θ))

                                     y = y + (D * cosine (θ))
                                     θ = θ  + α
                       Where x and y are the Cartesian coordinates of the platform
                       position and θ is its heading.

               Note that the direction of a positive angle in navigation is usually clockwise, the
               opposite convention of that used in geometry. It is not important which system is
               used, or along which axis the zero heading is assumed, as long as these are used con-
               sistently. I prefer the “map” system, with zero heading being up the positive y-axis,
               and positive angles being clockwise.
               If the platform is operating over uneven terrain, it may be necessary to take into ac-
               count the pitch angle of the platform. In this case, the vector distance D would be
               multiplied by the cosine of the pitch ρ. The y-axis (altitude) position estimate of the
               platform would be changed by the sine of the pitch multiplied by the distance D.

                                     x = x + (D * sine (θ) * cosine (ρ))

                                     y = y + (D * cosine (θ) * cosine (ρ))
                                     z = z + (D * sine (ρ))

               The above calculations are valid for most skid-steered and differential drive platforms.
               With Synchro-drive vehicles, the process is even simpler, as the drive system is in-
               herently a polar coordinate system by nature. The angle of the steering encoder plus
               an offset angle yields the heading of the vehicle directly. Since these calculations may
               need to be executed many thousands of times per second, it is important to consider
               a number of factors.


               The tick interrupt
               If the interrupt is not processed quickly, it may overrun, or the next interrupt may
               not get processed. Therefore, the tick interrupt(s) should normally be the highest
               priority interrupts on the processor. This interrupt should never be masked for more
               than a few cycles at a time, and it should itself be uninterruptible. It is, however,
               important that this interrupt never occur when another process is accessing the
               position or heading estimates, as this may cause erroneous values to be used. Pro-
               cesses that must access this data should do so in a block move if possible.



                                                       125
   137   138   139   140   141   142   143   144   145   146   147