Path Tracking For A Miniature Robot
Path Tracking For A Miniature Robot
By
Martin Lundgren
Excerpt from Masters thesis 2003
Supervisor: Thomas Hellstrm
Department of Computing Science
Ume University
Sweden
1 Path Tracking
Path tracking is the process concerned with how to determine speed and steering settings at
each instant of time in order for the robot to follow a certain path. A path consists of a set of
points representing the positional coordinates of a particular route. Often when implementing
a path tracking algorithm, one also have to implement a path recording unit responsible for
saving all the coordinates that constitutes the path. A human operator then has the possibility
to manually steer the robot along some track while the path recording unit saves the
information about the path. The path tracking algorithm also has to handle unplanned
positional or orientation deviations from the path. Such deviations can be caused by
odometric errors of some kind, or by new obstacles occurring on the path that must be
avoided.
There are many different types of path tracking algorithms available today. I have chosen to
implement and evaluate three of the them on the Khepera robot; follow-the-carrot, pure
pursuit and vector pursuit. The first two methods has been around for quite a while now,
while vector pursuit or screw tracking as its also called is relatively new on the scene. The
big difference between these methods is that vector pursuit uses information about orientation
at the look-ahead point, while the others dont.
1.1 Follow-the-carrot
This algorithm is based on a very simple idea. Obtain a goal-point, then aim the vehicle
towards that point [10]. Figure 7 describes the basics behind this method.
Fig 7. Follow-the-carrot
A line is drawn from the centre of the vehicle coordinate system perpendicular to the path.
The carrot point, or goal point, is then defined to be the point on the path a look-ahead
distance away from the intersection point of this line. The most important parameter is the
orientation error, defined to be the angle between current vehicle heading and the line drawn
from the centre of the vehicle coordinate system to the carrot point. A proportional control
law then aims at minimizing the orientation error between the vehicle and the carrot point. An
orientation error of zero means the vehicle is pointing exactly towards the carrot point. The
magnitude of a turn is decided by:
= kp * e o
where kp is the proportional gain and eo is the orientation error. One also hade the possibility
of increasing the accuracy of the controller, perhaps adding integrative or derivative functions
to it [11]. However, simple proportional controllers are still the most frequently used in this
algorithm.
Although the follow-the-carrot approach is easy to understand and very simple to implement,
it has a couple of major drawbacks. Firstly, the vehicle has a tendency to naturally cut
corners. This happens because the vehicle immediately tries to turn towards each new carrot
point. Another drawback with this path tracking technique is that the vehicle could oscillate
about the path, particularly in the case of small look-ahead distances or at higher speeds.
There are however modifications that can be made to the algorithm to increase its efficiency
and accuracy. The selection of steering angle can be modified to be based on both the
positional error displacement perpendicular to the path and the orientation error [11]. Yet the
disadvantages of this method are generally to high, making it useless for implementation in
new projects that require good tracking ability. Still it is very suitable for educational
purposes, or for comparison with other tracking algorithms.
It is important to note that the description of the pure pursuit algorithm in figure 8 is shown in
vehicle coordinates. The vehicle coordinate system is defined where the y-axis is in the
forward direction of the vehicle, the z-axis is down and the x-axis forms a right-handed
coordinate system. Therefore all coordinates used must first be transformed to vehicle
coordinates in order for the algorithm to work properly. Luckily it is pretty straight forward to
converts coordinates located in one system into its representation in another system [9]. Let
(xr,yr) be the current position of the robot, and (xg,yg) the goal point to be converted into
vehicle coordinates. Then
xgv = (xg xr)cos() + (yg-yr)sin()
ygv = -(xg xr)sin() + (yg-yr)cos()
where (xgv,ygv) is the goal point in vehicle coordinates and is the current vehicle heading.
In the figure above D is defined to be the distance between current vehicle position and the
goal point. x is the x offset of the goal point from the origin, and 1/r is the radius of the
circle that goes through the centre of the vehicle and the goal point. The required curvature of
the vehicle is computed by:
r
= 2x/D2
The derivation of this formula is based on just two simple equations [5]:
1) x2 + y2 = D2
2) x + d = r
(x,y) being the coordinates of the goal point in figure 8 above. The first equation is a result of
applying Pythagoras theorem on the smaller right triangle in the same figure, and the second
equation comes from summing the line segments on the x-axis. The following derivation is
pretty straightforward and should not be that difficult to understand:
d = r x
(r x)2 + y2 = r2
r2 2rx + x2 + y2 = r2
2rx = D2
r = D2/2x
r = 2x/D2
The last step comes from the mathematical fact that a circle has a constant curvature which is
inversely proportional to its radius.
The name pure pursuit comes from our way of describing this method. We paint a picture in
our minds of the vehicle chasing this goal point on the path a defined distance in front of it - it
is always in pursue of the point. This can also be compared to the way humans drive their
cars. We usually look at some distance in front of the car, and pursue that spot.
Assuming that the points that constitutes the path and the successive positions of the robot
vehicle belongs to the same coordinate system, the pure pursuit algorithm can be described by
these simple steps:
L=
M=
N=
x2x1
(x2x1)2+( y2y1)2 (z2z1)2
y2y1
( x2x1)2+( y2y1)2 (z2z1)2
z2z1
( x2x1)2+( y2y1)2 ( z2z1)2
and
P = y1 N z1 M
Q = z1 L x1 N
R = x1 M y1 L
As explained earlier any instantaneous motion of a rigid body can be described as a rotation
about a line in space with an associated pitch. Figure 10 shows such a body rotating with an
angular velocity , about a screw S defined by its centreline (S ; S0). The pitch of the screw is
also shown in the figure.
The velocity of a rigid body depends on both the velocity due to the rotation and the
translational velocity due to the pith of the screw. This velocity is represented as:
$ = (S ; Soh)
(4.3.1)
where
Soh = So + hS = r x S + hS
and r is any vector from the origin to the centreline of the screw.
The vector pursuit method developed by Wit (2001) calculates two instantaneous screws. The
first screw accounts for the translation from the current vehicle position to the look-ahead
point, while the second screw represents the rotation from the current vehicle orientation to
the orientation at the look-ahead point. These two screws are then added together to form the
desired instantaneous motion of the vehicle. This information is then used for calculating the
desired turning radius that will take the vehicle from its current position to the goal point.
Pure translation of a rigid body is defined as the motion about a screw with an infinite pitch,
and therefore (4.3.1) becomes v$ = (0 ; vS). Pure rotation on the other hand is defined by the
motion about a screw with a pitch equal to zero, and (4.3.1) reduces to $ = (S ; So). Then
depending on whether the nonholonomic constraints of the vehicle are initially ignored or not,
the screws with respect to translation and rotation are calculated and summed up to form the
desired instantaneous motion of the vehicle.
The results of the testing performed by Wit [3] both on real vehicles as well as in simulation
shows comparable tracking results to the other methods described earlier. Vector pursuit
showed particularly good skills in handling jogs appearing suddenly in the middle of the path.
This means the method is doing rather good jumping from a small error in position and
orientation to fairly large errors. Similar situations can occur in the real world when the robot
vehicle detects sudden obstacles appearing on the path, forcing the vehicle to drive around the
obstacle and then return to the path. It can also occur if there is noise in the position
estimations, which can happen if the vehicle was using GPS techniques for localizing. In
other test cases vector pursuit shows comparable results to the pure pursuit algorithm. This is
not so surprising, because both methods calculates a desired radius of curvature and the centre
point of rotation when tracking a curved path.
the end be a question of in what context you want the tracker to provide good results. There
are two problems that need to be considered:
I. Regaining a path
II. Maintaining the path
The first problem occurs when the vehicle is way off the path, thus having large positional
and orientation errors, and is trying to return to this path. Under this circumstances it is pretty
obvious what the effects will be of changing the look-ahead distance. A larger value
causes the vehicle to converge more smoothly and with less oscillations. On the other side,
once back on the path a large value will lead to worse tracking, especially in the case of paths
containing very sharp curves. So a difficult trade-off must often be made when choosing the
look-ahead distance for a particular path tracking algorithm. Do I expect the vehicle to
encounter obstacles while in tracking mode, causing large positional errors? Or is it more
likely the path will be obstacle free but rather curvy? These are questions that must be
considered before implementing any systems of this kind.
Small L
path
Large L
Fig 11. The effects of having a small lookahead distance contra a large for problem 1
Another factor that must be considered when choosing look-ahead distance L is the vehicle
speed. An increase in vehicle speed would also require the distance L to be increased. The
reason for this is that higher speeds requires the vehicle to start turning at an earlier stage.
Generally the vehicle always starts turning before the curve at every look-ahead distance
larger than zero. This is a positive quality that compensates for the time needed in the
execution phase of the turn. Good tracking ability at high speeds is of great importance, and
therefore a high priority for real world robot vehicle applications today. As everyone knows,
time and money goes hand in hand. Tracking a path in five minutes is better than to do it in
ten, and doing so while not loosing accuracy is even better.
References
[1]
[2]