SITL: Frame: stop adding random physics noise

This commit is contained in:
Iampete1 2022-04-20 18:56:12 +01:00 committed by Peter Barker
parent f869506b0a
commit 92135400f8
2 changed files with 0 additions and 12 deletions

View File

@ -515,7 +515,6 @@ void Frame::init(const char *frame_str, Battery *_battery)
float hover_velocity_out = 2 * hover_power / hover_thrust; float hover_velocity_out = 2 * hover_power / hover_thrust;
float effective_disc_area = hover_thrust / (0.5 * ref_air_density * sq(hover_velocity_out)); float effective_disc_area = hover_thrust / (0.5 * ref_air_density * sq(hover_velocity_out));
float velocity_max = hover_velocity_out / sqrtf(model.hoverThrOut); float velocity_max = hover_velocity_out / sqrtf(model.hoverThrOut);
thrust_max = 0.5 * ref_air_density * effective_disc_area * sq(velocity_max);
float effective_prop_area = effective_disc_area / num_motors; float effective_prop_area = effective_disc_area / num_motors;
// power_factor is ratio of power consumed per newton of thrust // power_factor is ratio of power consumed per newton of thrust
@ -649,16 +648,6 @@ void Frame::calculate_forces(const Aircraft &aircraft,
body_accel += drag_bf / mass; body_accel += drag_bf / mass;
} }
// add some noise
const float gyro_noise = radians(0.1);
const float accel_noise = 0.3;
const float noise_scale = thrust.length() / thrust_max;
rot_accel += Vector3f(aircraft.rand_normal(0, 1),
aircraft.rand_normal(0, 1),
aircraft.rand_normal(0, 1)) * gyro_noise * noise_scale;
body_accel += Vector3f(aircraft.rand_normal(0, 1),
aircraft.rand_normal(0, 1),
aircraft.rand_normal(0, 1)) * accel_noise * noise_scale;
} }

View File

@ -158,7 +158,6 @@ private:
// exposed area times coefficient of drag // exposed area times coefficient of drag
float areaCd; float areaCd;
float mass; float mass;
float thrust_max;
float last_param_voltage; float last_param_voltage;
#if AP_SIM_ENABLED #if AP_SIM_ENABLED
Battery *battery; Battery *battery;