Skip to content

Path Following

Accurate path following for pipeline inspection, transect surveys, and complex trajectories.

Path Types

Linear Path

Straight-line segments between points

Curved Path

Smooth curves using splines or Bezier curves

Circular Arc

Constant-radius turns

Clothoid

Variable-curvature transitions

Path Following Algorithms

Pure Pursuit

Geometric path tracker that computes steering angle to intersect path ahead.

def pure_pursuit(path, vehicle_pos, lookahead_dist):
    # Find lookahead point
    lookahead_point = find_point_on_path(path, vehicle_pos, lookahead_dist)

    # Compute steering angle
    alpha = atan2(lookahead_point.y - vehicle_pos.y, 
                   lookahead_point.x - vehicle_pos.x)

    return alpha - vehicle_pos.heading

Line-of-Sight (LOS) Guidance

Better for marine vehicles with sideslip:

def los_guidance(path, vehicle_pos, los_distance):
    # Project position onto path
    closest_point = project_to_path(vehicle_pos, path)

    # Lookahead point
    los_point = closest_point + los_distance * path_tangent

    # Desired heading
    desired_heading = atan2(los_point.y - vehicle_pos.y,
                            los_point.x - vehicle_pos.x)

    return desired_heading

Model Predictive Control (MPC)

Optimal control over prediction horizon:

  • Considers vehicle dynamics
  • Respects velocity/acceleration limits
  • Handles constraints
  • Most computationally expensive

Cross-Track Error Control

Minimize perpendicular distance to path:

cross_track_error = distance_to_path(vehicle_pos, path)

# PID controller
correction = -Kp * cross_track_error \
             -Ki * integral_error \
             -Kd * derivative_error

Velocity Control Along Path

Adapt speed based on path curvature:

def compute_speed(curvature, max_speed, min_speed):
    # Slow down in turns
    curvature_speed = max_speed / (1 + abs(curvature) * 10)

    return max(min_speed, min(max_speed, curvature_speed))

Applications

Pipeline Inspection

Follow pipeline at constant offset and altitude

Transect Survey

Execute parallel survey lines

Perimeter Patrol

Follow facility boundary

Terrain Following

Maintain constant altitude above seafloor

Configuration

path_following:
  algorithm: los
  lookahead_distance: 2.5
  cross_track_gain: 0.8
  velocity_lookahead: 5.0
  max_cross_track_error: 5.0

Next: Behavior Trees