path_follower

path_follower

The path_follower package is to control the vehicle using Pure Pursuit (PP) controller. The logic is described as follows.

Inputs

Following are the arguments are required by path_follower.launch package

Vehicle State

NameDescription
/state/xglobal x position (m)
/state/yglobal y position (m)
/state/psiglobal heading angle (rad)
/state/uxvelocity in the x direction (vehicle frame) in (m/s)

Trajectories

NameDescription
/trajectory/xglobal x position trajectory (m)
/trajectory/yglobal y position trajectory (m)

Output

The output of this package is as follows.

Vehicle State

NameDescription
/control/sasteering angle at the tire (rad)
/control/thrthrottle input, range: [0, 1]
/control/brkbreak input, range: [0, 1]

Logic

The Logic of the Pure Pursuit (PP) controller is shown in the figure below.

link

When a path is given to the vehicle to follow, we will first draw an arc AB with radius R1, and the center of the arc is the vehicle itself. R1 can is chosen to be proportional to the vehicle speed, R1=Kv, with saturation Rmax and Rmin to avoid the case of no solution. Then, find the intersection (point D) between arc AB and the planned path, and express the position of point D as (xD, yD) using the vehicle coordinate system. Point D is the position where the vehicle wants to arrive next. To command the vehicle to head towards point D, we fit another arc CD which passes through the current vehicle position (0, 0) and (xD, yD), and the direction of the arc at (0, 0) is straight up. The radius of the arc CD is R2, which is also the radius of curvature of the real vehicle path. Then, the relationship between R2 and (xD, yD) can be expressed as

link

Then we have

link

The radius of curvature R_2 is closely related to the steering angle as shown in the figure below. Point E is the instantaneous rotation center of the vehicle.

link

Finally, assume there is no slip between tires and the ground. The relationship between the steering angle and the radius of curvature R_2 is

link

Where L is the wheelbase.