From 6a44fc7cac67733c8316d28207b990bc2a3e291f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 25 Jun 2021 14:22:27 +0200 Subject: [PATCH] fix vtol_att_control: set _current_max_pwm_values to current values on init --- src/modules/vtol_att_control/vtol_type.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/modules/vtol_att_control/vtol_type.cpp b/src/modules/vtol_att_control/vtol_type.cpp index af1c44c122..50ece35cc8 100644 --- a/src/modules/vtol_att_control/vtol_type.cpp +++ b/src/modules/vtol_att_control/vtol_type.cpp @@ -77,8 +77,6 @@ VtolType::VtolType(VtolAttitudeControl *att_controller) : for (auto &pwm_disarmed : _disarmed_pwm_values.values) { pwm_disarmed = PWM_MOTOR_OFF; } - - _current_max_pwm_values = _max_mc_pwm_values; } bool VtolType::init() @@ -93,7 +91,7 @@ bool VtolType::init() } int ret = px4_ioctl(fd, PWM_SERVO_GET_MAX_PWM, (long unsigned int)&_max_mc_pwm_values); - + _current_max_pwm_values = _max_mc_pwm_values; if (ret != PX4_OK) { PX4_ERR("failed getting max values");