src/automodelcar/src/lane_follower/lane_follower.h
/*
  * Saturates the servo PWM value accordingly to the 
  * servo limits.
  */
Saturates the servo PWM value accordingly to the
servo limits.
Saturates the servo PWM value accordingly to the servo limits .
int ServoSaturation(
    int calculated_servo_PWM,
    int current_steering_PWM)
{
    if (calculated_servo_PWM > current_steering_PWM + SERVO_STEP)
    {
        current_steering_PWM += SERVO_STEP;
    }
    else if (calculated_servo_PWM < current_steering_PWM - SERVO_STEP)
    {
        current_steering_PWM -= SERVO_STEP;
    }
    if (current_steering_PWM > MAX_STEERING_ANGLE_RIGHT)
    {
        current_steering_PWM = MAX_STEERING_ANGLE_RIGHT;
    }
    else if (current_steering_PWM < MAX_STEERING_ANGLE_LEFT)
    {
        current_steering_PWM = MAX_STEERING_ANGLE_LEFT;
    }
    return current_steering_PWM;
}
int ServoSaturation ( int calculated_servo_PWM , int current_steering_PWM ) { if ( calculated_servo_PWM > current_steering_PWM + SERVO_STEP ) { current_steering_PWM += SERVO_STEP ; } else if ( calculated_servo_PWM < current_steering_PWM - SERVO_STEP ) { current_steering_PWM -= SERVO_STEP ; } if ( current_steering_PWM > MAX_STEERING_ANGLE_RIGHT ) { current_steering_PWM = MAX_STEERING_ANGLE_RIGHT ; } else if ( current_steering_PWM < MAX_STEERING_ANGLE_LEFT ) { current_steering_PWM = MAX_STEERING_ANGLE_LEFT ; } return current_steering_PWM ; }
Saturates the servo PWM value accordingly to the
 servo limits.
Saturates the servo PWM value accordingly to the servo limits .