|
|
@ -150,8 +150,6 @@ private: |
|
|
|
perf_counter_t _nonfinite_input_perf; /**< performance counter for non finite input */ |
|
|
|
perf_counter_t _nonfinite_input_perf; /**< performance counter for non finite input */ |
|
|
|
perf_counter_t _nonfinite_output_perf; /**< performance counter for non finite output */ |
|
|
|
perf_counter_t _nonfinite_output_perf; /**< performance counter for non finite output */ |
|
|
|
|
|
|
|
|
|
|
|
bool _debug; /**< if set to true, print debug output */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
float _flaps_applied; |
|
|
|
float _flaps_applied; |
|
|
|
float _flaperons_applied; |
|
|
|
float _flaperons_applied; |
|
|
|
|
|
|
|
|
|
|
@ -358,7 +356,6 @@ FixedwingAttitudeControl::FixedwingAttitudeControl() : |
|
|
|
_nonfinite_input_perf(perf_alloc(PC_COUNT, "fwa_nani")), |
|
|
|
_nonfinite_input_perf(perf_alloc(PC_COUNT, "fwa_nani")), |
|
|
|
_nonfinite_output_perf(perf_alloc(PC_COUNT, "fwa_nano")), |
|
|
|
_nonfinite_output_perf(perf_alloc(PC_COUNT, "fwa_nano")), |
|
|
|
/* states */ |
|
|
|
/* states */ |
|
|
|
_debug(false), |
|
|
|
|
|
|
|
_flaps_applied(0), |
|
|
|
_flaps_applied(0), |
|
|
|
_flaperons_applied(0), |
|
|
|
_flaperons_applied(0), |
|
|
|
_roll(0.0f), |
|
|
|
_roll(0.0f), |
|
|
@ -1004,10 +1001,6 @@ void FixedwingAttitudeControl::run() |
|
|
|
if (!PX4_ISFINITE(roll_u)) { |
|
|
|
if (!PX4_ISFINITE(roll_u)) { |
|
|
|
_roll_ctrl.reset_integrator(); |
|
|
|
_roll_ctrl.reset_integrator(); |
|
|
|
perf_count(_nonfinite_output_perf); |
|
|
|
perf_count(_nonfinite_output_perf); |
|
|
|
|
|
|
|
|
|
|
|
if (_debug && loop_counter % 10 == 0) { |
|
|
|
|
|
|
|
warnx("roll_u %.4f", (double)roll_u); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float pitch_u = _pitch_ctrl.control_euler_rate(control_input); |
|
|
|
float pitch_u = _pitch_ctrl.control_euler_rate(control_input); |
|
|
@ -1017,21 +1010,6 @@ void FixedwingAttitudeControl::run() |
|
|
|
if (!PX4_ISFINITE(pitch_u)) { |
|
|
|
if (!PX4_ISFINITE(pitch_u)) { |
|
|
|
_pitch_ctrl.reset_integrator(); |
|
|
|
_pitch_ctrl.reset_integrator(); |
|
|
|
perf_count(_nonfinite_output_perf); |
|
|
|
perf_count(_nonfinite_output_perf); |
|
|
|
|
|
|
|
|
|
|
|
if (_debug && loop_counter % 10 == 0) { |
|
|
|
|
|
|
|
warnx("pitch_u %.4f, _yaw_ctrl.get_desired_rate() %.4f," |
|
|
|
|
|
|
|
" airspeed %.4f, airspeed_scaling %.4f," |
|
|
|
|
|
|
|
" roll_sp %.4f, pitch_sp %.4f," |
|
|
|
|
|
|
|
" _roll_ctrl.get_desired_rate() %.4f," |
|
|
|
|
|
|
|
" _pitch_ctrl.get_desired_rate() %.4f" |
|
|
|
|
|
|
|
" att_sp.roll_body %.4f", |
|
|
|
|
|
|
|
(double)pitch_u, (double)_yaw_ctrl.get_desired_rate(), |
|
|
|
|
|
|
|
(double)airspeed, (double)airspeed_scaling, |
|
|
|
|
|
|
|
(double)roll_sp, (double)pitch_sp, |
|
|
|
|
|
|
|
(double)_roll_ctrl.get_desired_rate(), |
|
|
|
|
|
|
|
(double)_pitch_ctrl.get_desired_rate(), |
|
|
|
|
|
|
|
(double)_att_sp.roll_body); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
float yaw_u = 0.0f; |
|
|
|
float yaw_u = 0.0f; |
|
|
@ -1055,10 +1033,6 @@ void FixedwingAttitudeControl::run() |
|
|
|
_yaw_ctrl.reset_integrator(); |
|
|
|
_yaw_ctrl.reset_integrator(); |
|
|
|
_wheel_ctrl.reset_integrator(); |
|
|
|
_wheel_ctrl.reset_integrator(); |
|
|
|
perf_count(_nonfinite_output_perf); |
|
|
|
perf_count(_nonfinite_output_perf); |
|
|
|
|
|
|
|
|
|
|
|
if (_debug && loop_counter % 10 == 0) { |
|
|
|
|
|
|
|
warnx("yaw_u %.4f", (double)yaw_u); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* throttle passed through if it is finite and if no engine failure was detected */ |
|
|
|
/* throttle passed through if it is finite and if no engine failure was detected */ |
|
|
@ -1071,19 +1045,8 @@ void FixedwingAttitudeControl::run() |
|
|
|
_actuators.control[actuator_controls_s::INDEX_THROTTLE] *= _battery_status.scale; |
|
|
|
_actuators.control[actuator_controls_s::INDEX_THROTTLE] *= _battery_status.scale; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!PX4_ISFINITE(throttle_sp)) { |
|
|
|
|
|
|
|
if (_debug && loop_counter % 10 == 0) { |
|
|
|
|
|
|
|
warnx("throttle_sp %.4f", (double)throttle_sp); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
perf_count(_nonfinite_input_perf); |
|
|
|
perf_count(_nonfinite_input_perf); |
|
|
|
|
|
|
|
|
|
|
|
if (_debug && loop_counter % 10 == 0) { |
|
|
|
|
|
|
|
warnx("Non-finite setpoint roll_sp: %.4f, pitch_sp %.4f", (double)roll_sp, (double)pitch_sp); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|