aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-06-24 20:52:24 +0200
committerThomas Gubler <thomasgubler@gmail.com>2014-06-24 20:52:24 +0200
commit819812e11271d7b78f4af2d5bbb7ac6e4be9e494 (patch)
tree7ddb8aa41dcfed411990c58ae1c4515e7809fe6e /src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
parent9904ed878e6a1b006c8937c8c2060494ca61fb1b (diff)
downloadpx4-firmware-819812e11271d7b78f4af2d5bbb7ac6e4be9e494.tar.gz
px4-firmware-819812e11271d7b78f4af2d5bbb7ac6e4be9e494.tar.bz2
px4-firmware-819812e11271d7b78f4af2d5bbb7ac6e4be9e494.zip
fw pos ctrl: move setting of attitude integral reset flag
Diffstat (limited to 'src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp')
-rw-r--r--src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
index 518116fa1..fe5847682 100644
--- a/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
+++ b/src/modules/fw_pos_control_l1/fw_pos_control_l1_main.cpp
@@ -1032,12 +1032,15 @@ FixedwingPositionControl::control_position(const math::Vector<2> &current_positi
// warnx("Launch detection running");
mavlink_log_info(_mavlink_fd, "#audio: Launchdetection running");
last_sent = hrt_absolute_time();
- /* Tell the attitude controller to stop integrating while we are
- * waiting for the launch */
- _att_sp.roll_reset_integral = true;
- _att_sp.pitch_reset_integral = true;
- _att_sp.yaw_reset_integral = true;
}
+
+ /* Tell the attitude controller to stop integrating while we are waiting
+ * for the launch */
+ _att_sp.roll_reset_integral = true;
+ _att_sp.pitch_reset_integral = true;
+ _att_sp.yaw_reset_integral = true;
+
+ /* Detect launch */
launchDetector.update(_sensor_combined.accelerometer_m_s2[0]);
if (launchDetector.getLaunchDetected()) {
launch_detected = true;