Copter: add floating-point-constant designators

This commit is contained in:
Peter Barker 2019-04-04 16:41:10 +11:00 committed by Tom Pittenger
parent 85b737db31
commit 3b33f4ca4d
3 changed files with 5 additions and 5 deletions

View File

@ -591,7 +591,7 @@ float Copter::Mode::get_pilot_desired_throttle() const
throttle_in = 0.5f + ((float)(throttle_control-mid_stick)) * 0.5f / (float)(1000-mid_stick);
}
float expo = constrain_float(-(thr_mid-0.5)/0.375, -0.5f, 1.0f);
const float expo = constrain_float(-(thr_mid-0.5f)/0.375f, -0.5f, 1.0f);
// calculate the output throttle using the given expo function
float throttle_out = throttle_in*(1.0f-expo) + expo*throttle_in*throttle_in*throttle_in;
return throttle_out;

View File

@ -669,13 +669,13 @@ private:
void update_height_estimate(void);
// minimum assumed height
const float height_min = 0.1;
const float height_min = 0.1f;
// maximum scaling height
const float height_max = 3.0;
const float height_max = 3.0f;
AP_Float flow_max;
AC_PI_2D flow_pi_xy{0.2, 0.3, 3000, 5, 0.0025};
AC_PI_2D flow_pi_xy{0.2f, 0.3f, 3000, 5, 0.0025f};
AP_Float flow_filter_hz;
AP_Int8 flow_min_quality;
AP_Int8 brake_rate_dps;

View File

@ -206,7 +206,7 @@ void Copter::radio_passthrough_to_motors()
{
motors->set_radio_passthrough(channel_roll->norm_input(),
channel_pitch->norm_input(),
channel_throttle->get_control_in_zero_dz()*0.001,
channel_throttle->get_control_in_zero_dz()*0.001f,
channel_yaw->norm_input());
}