FW Attitdue controller: fix throttle in acro (use _rate_sp.throttle_body) (#20330)

* FW Attitdue controller: fix throttle in acro (use _rate_sp.throttle_body)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

* FW Attitude controller: do manual control polling before attitude setpoint polling

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2022-09-30 13:45:20 +02:00 committed by GitHub
parent 34b6786f79
commit 9b3cb6c758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -353,13 +353,14 @@ void FixedwingAttitudeControl::Run()
const matrix::Eulerf euler_angles(_R);
vehicle_manual_poll(euler_angles.psi());
vehicle_attitude_setpoint_poll();
// vehicle status update must be before the vehicle_control_mode_poll(), otherwise rate sp are not published during whole transition
_vehicle_status_sub.update(&_vehicle_status);
vehicle_control_mode_poll();
vehicle_manual_poll(euler_angles.psi());
vehicle_land_detected_poll();
// the position controller will not emit attitude setpoints in some modes
@ -608,7 +609,7 @@ void FixedwingAttitudeControl::Run()
/* throttle passed through if it is finite */
_actuator_controls.control[actuator_controls_s::INDEX_THROTTLE] =
(PX4_ISFINITE(_att_sp.thrust_body[0])) ? _att_sp.thrust_body[0] : 0.0f;
(PX4_ISFINITE(_rates_sp.thrust_body[0])) ? _rates_sp.thrust_body[0] : 0.0f;
/* scale effort by battery status */
if (_param_fw_bat_scale_en.get() &&