Class SteeringController

Class Documentation

class SteeringController

Public Functions

SteeringController()

Constructor for the steering_controller class.

void initialize(const float &wb, const float &max_steer, const float &kk_s, const float &kd_s, const float &k_stanley)

set the parameters for the steering controller

Parameters:
  • wb – Wheelbase of the vehicle

  • max_steer – Maximum steering angle (in radians)

  • kk_s – Proportional gain for PD controller

  • kd_s – Derivative gain for PD controller

  • k_stanley – Gain for Stanley controller

float pd_controller(const float &xc, const float &yc, const float &yawc, const float &la_x, const float &la_y)

PD controller for steering.

Parameters:
  • xc – Current x position

  • yc – Current y position

  • yawc – Current yaw angle

  • la_x – Look-ahead x position

  • la_y – Look-ahead y position

Returns:

float Calculated steering angle in radians

float geometric_controller(const float &xc, const float &yc, const float &yawc, const float &la_x, const float &la_y, const float &look_ahead_distance)

Pure pursuit-based steering control.

Parameters:
  • xc – Current x position

  • yc – Current y position

  • yawc – Current yaw angle

  • la_x – Look-ahead x position

  • la_y – Look-ahead y position

  • look_ahead_distance – Look-ahead distance

Returns:

float Calculated steering angle in radians

float stanley_controller(const float &yaw_desired, const float &yawc, const float &distance_n, const float &speed)

Stanley method for steering control.

Parameters:
  • yaw_desired – Current yaw desired

  • yawc – Current yaw angle

  • distance_n – Minimal distance to the path

  • speed – Actual speed

Returns:

float Calculated steering angle in radians