Library / Guidance and trajectory following / GUI-03
Guidance and trajectory following
Course command for straight-path following
Course to fly to rejoin a straight path: the path course turned towards the line by an intercept angle that grows with the cross-track error and shrinks with the lookahead distance Δ.
- Ref
- GUI-03
- Rev
- v1
- Field
- Guidance and trajectory following
- Result
- χcmd [°]
To rejoin a straight path the vehicle steers towards a point a distance Δ ahead along the path. For a cross-track error e⊥ that point is at an angle arctan(e⊥/Δ) to the path, so the command is χcmd = χp − arctan(e⊥/Δ). A vehicle to the right (positive e⊥) is told to point to the left of the path course. The intercept angle never exceeds 90°. The command is shown between 0° and 360°.
Course to fly to rejoin a straight path: the path course turned towards the line by an intercept angle that grows with the cross-track error and shrinks with the lookahead distance Δ.
Calculator
- Intercept angle, arctan(e⊥/Δ)19.29 °
- Ratio e⊥/Δ0.35
- Time constant of the approach, Δ/V (at V = 20 m/s)10 s
What drives the result
Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.
- A vehicle 70 m to the right of a path heading 90° is told to steer 70.71°, turned 19.3° towards the line. As the error falls, the angle shrinks and the vehicle settles smoothly on to the path.
- A lookahead of 500 m instead of 200 m reduces the angle to 7.97°, a gentler approach that takes longer. For small errors the error decays with a time constant of about Δ/V, 10 s at 20 m/s, if the course is tracked well.
Chart data as tables
Ranked variables
| Variable | Typical range | Lowest result | Highest result | Swing (°) | Local step | Change in result |
|---|---|---|---|---|---|---|
| χp Path course (clockwise from north) | 0 to 360 ° | 4.71 | 352.7 | 348 | +10% | +9 ° |
| e⊥ Cross-track error (right positive) | −300 to 300 m | 33.69 | 146.3 | 112.6 | +12 m | −3 ° |
| Δ Lookahead distance | 50 to 1,000 m | 35.54 | 86 | 50.46 | +10% | +1.64 ° |
Sweep of Cross-track error (right positive)
| Cross-track error (right positive) (m) | Commanded course (°) |
|---|---|
| −300 | 146.3 |
| −225 | 138.4 |
| −150 | 126.9 |
| −75 | 110.6 |
| 0 | 90 |
| 75 | 69.44 |
| 150 | 53.13 |
| 225 | 41.63 |
| 300 | 33.69 |
Sweep one variable
Variables and how each one contributes
Commanded course
What the equation gives you. Everything else feeds it.
Path course (clockwise from north)
The course of the path in degrees, clockwise from north. The command follows the path course one for one. Raising it by 10° (to 100°) moves the result by +14.1 %, from 70.71 to 80.71 °.
Cross-track error (right positive)
The cross-track error in m. Positive is to the right of the path. A larger error to the right turns the command further left of the path course. Raising it by 30 m (to 100 m) moves the result by −10.3 %, from 70.71 to 63.43 °.
Lookahead distance
The lookahead distance Δ in m: how far ahead along the path the vehicle aims. A longer lookahead gives a gentler intercept angle, so the command stays closer to the path course. Raising it by 10 % (to 220) moves the result by +2.32 %, from 70.71 to 72.35 °.
Worked example with the values above
- Ratio: e⊥/Δ = 70 / 200 = 0.35.
- Intercept angle: arctan(0.35) = 19.29°.
- χcmd = 90° − 19.29° = 70.71°.
Assumptions and limits
- A straight path, and a vehicle that tracks its commanded course well compared with the lookahead time.
- A fixed lookahead distance Δ > 0, with courses in degrees clockwise from north.
Common mistakes
- Using a very small lookahead. It gives violent turns and chatter, and ignores the turn dynamics of the vehicle.
- Using a very large lookahead, which cuts corners and responds slowly to a real offset.
Statistics and uncertainty
The lookahead trades response for noise: a small Δ gives a sharp intercept that amplifies position noise into course commands, since the angle is about e⊥/Δ radians. A cross-track error that is wrong by 5 m produces about 1.4° of command error with Δ = 200 m, but 5.7° with Δ = 50 m.
Where it is used
- Waypoint-leg following for aircraft, ships and ground vehicles.
- Choosing the lookahead distance to set how aggressively a path is rejoined.
Maths you need
- Arctangent: the angle whose tangent is the given ratio
- Cross-track error: sideways distance from the path