mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
fix(fw_att_control): guard against 0 in param
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user