Dear all,
speed_max = (1.0f / cruise_throttle) * cruise_speed;
This line of code means the maximum speed is inversely proportional to cruise_throttle. I am suspicious about the correctness of this? Am I right?
The code is as the following:
// estimate maximum vehicle speed (in m/s)
float Mode::calc_speed_max(float cruise_speed, float cruise_throttle)
{ EXECUTE_MARK();
float speed_max;
// sanity checks
if (cruise_throttle > 1.0f || cruise_throttle < 0.05f) {
speed_max = cruise_speed;
} else {
// project vehicle’s maximum speed
speed_max = (1.0f / cruise_throttle) * cruise_speed;
}
// constrain to 30m/s (108km/h) and return
return constrain_float(speed_max, 0.0f, 30.0f);
}
Thank you very much for you reply.