Skip to content

Commit 03b4ad4

Browse files
breschsfuhrer
authored andcommitted
fw-att: fix wheel controller
1 parent 5100010 commit 03b4ad4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/modules/fw_att_control/FixedwingAttitudeControl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ void FixedwingAttitudeControl::Run()
215215
_last_run = time_now_us;
216216
}
217217

218-
vehicle_angular_velocity_s angular_velocity{};
219-
_vehicle_rates_sub.copy(&angular_velocity);
220-
221218
if (_vehicle_status.is_vtol_tailsitter) {
222219
/* vehicle is a tailsitter, we need to modify the estimated attitude for fw mode
223220
*
@@ -389,10 +386,13 @@ void FixedwingAttitudeControl::Run()
389386
wheel_u = _manual_control_setpoint.yaw;
390387

391388
} else {
389+
vehicle_angular_velocity_s angular_velocity{};
390+
_vehicle_rates_sub.copy(&angular_velocity);
391+
392392
// XXX: yaw_sp_move_rate here is an abuse -- used to ferry manual yaw inputs from
393393
// position controller during auto modes _manual_control_setpoint.r gets passed
394394
// whenever nudging is enabled, otherwise zero
395-
const float wheel_controller_output = _wheel_ctrl.control_bodyrate(dt, euler_angles.psi(), _groundspeed,
395+
const float wheel_controller_output = _wheel_ctrl.control_bodyrate(dt, angular_velocity.xyz[2], _groundspeed,
396396
groundspeed_scale);
397397
wheel_u = wheel_control ? wheel_controller_output + _att_sp.yaw_sp_move_rate : 0.f;
398398
}

0 commit comments

Comments
 (0)