diff --git a/src/modules/fw_att_control/CMakeLists.txt b/src/modules/fw_att_control/CMakeLists.txt index 749519f9b9..f3f9b458c5 100644 --- a/src/modules/fw_att_control/CMakeLists.txt +++ b/src/modules/fw_att_control/CMakeLists.txt @@ -43,4 +43,4 @@ px4_add_module( px4_work_queue ) -px4_add_unit_gtest(SRC FixedwingAttitudeControlTest.cpp) +px4_add_unit_gtest(SRC FixedwingAttitudeControlTest.cpp LINKLIBS modules__fw_att_control) diff --git a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp index 6ddf57e49f..9323aca6fd 100644 --- a/src/modules/fw_att_control/FixedwingAttitudeControl.cpp +++ b/src/modules/fw_att_control/FixedwingAttitudeControl.cpp @@ -74,8 +74,8 @@ FixedwingAttitudeControl::init() void FixedwingAttitudeControl::parameters_update() { - _proportional_gain = matrix::Vector3f(1.0f / _param_fw_r_tc.get(), - 1.0f / _param_fw_p_tc.get(), + _proportional_gain = matrix::Vector3f(1.0f / math::max(0.01f, _param_fw_r_tc.get()), + 1.0f / math::max(0.01f, _param_fw_p_tc.get()), 1.0f); _wheel_ctrl.set_k_p(_param_fw_wr_p.get());