From 41c1e5607517ef6dff95f1b508460ce2809f2f94 Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Fri, 22 Apr 2016 17:47:22 -0400 Subject: [PATCH] FW stabalized mode properly initialize att_sp --- src/modules/fw_att_control/fw_att_control_main.cpp | 6 +++++- src/modules/sensors/sensors.cpp | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp index e7cf9cc851..e62c811f4a 100644 --- a/src/modules/fw_att_control/fw_att_control_main.cpp +++ b/src/modules/fw_att_control/fw_att_control_main.cpp @@ -1063,13 +1063,17 @@ FixedwingAttitudeControl::task_main() * emit the manual setpoint here to allow attitude controller tuning * in attitude control mode. */ - struct vehicle_attitude_setpoint_s att_sp; + struct vehicle_attitude_setpoint_s att_sp = {}; att_sp.timestamp = hrt_absolute_time(); att_sp.roll_body = roll_sp; att_sp.pitch_body = pitch_sp; att_sp.yaw_body = 0.0f - _parameters.trim_yaw; att_sp.thrust = throttle_sp; + att_sp.roll_reset_integral = false; + att_sp.pitch_reset_integral = false; + att_sp.yaw_reset_integral = false; + /* lazily publish the setpoint only once available */ if (_attitude_sp_pub != nullptr) { /* publish the attitude setpoint */ diff --git a/src/modules/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp index 6805823465..5bcf253f53 100644 --- a/src/modules/sensors/sensors.cpp +++ b/src/modules/sensors/sensors.cpp @@ -2203,11 +2203,17 @@ Sensors::task_main() /* If the secondary failed as well, go to the tertiary, also only if available. */ if (hrt_elapsed_time(&raw.gyro_timestamp[1]) > 20 * 1000 && _gyro_sub[2] >= 0) { fds[0].fd = _gyro_sub[2]; - warnx("failing over to third gyro"); + + if (!_hil_enabled) { + warnx("failing over to third gyro"); + } } else if (_gyro_sub[1] >= 0) { fds[0].fd = _gyro_sub[1]; - warnx("failing over to second gyro"); + + if (!_hil_enabled) { + warnx("failing over to second gyro"); + } } }