Skip to content

Commit

Permalink
fw-att: fix wheel controller
Browse files Browse the repository at this point in the history
  • Loading branch information
bresch authored and sfuhrer committed Jan 3, 2025
1 parent 5100010 commit 03b4ad4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/fw_att_control/FixedwingAttitudeControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,6 @@ void FixedwingAttitudeControl::Run()
_last_run = time_now_us;
}

vehicle_angular_velocity_s angular_velocity{};
_vehicle_rates_sub.copy(&angular_velocity);

if (_vehicle_status.is_vtol_tailsitter) {
/* vehicle is a tailsitter, we need to modify the estimated attitude for fw mode
*
Expand Down Expand Up @@ -389,10 +386,13 @@ void FixedwingAttitudeControl::Run()
wheel_u = _manual_control_setpoint.yaw;

} else {
vehicle_angular_velocity_s angular_velocity{};
_vehicle_rates_sub.copy(&angular_velocity);

// XXX: yaw_sp_move_rate here is an abuse -- used to ferry manual yaw inputs from
// position controller during auto modes _manual_control_setpoint.r gets passed
// whenever nudging is enabled, otherwise zero
const float wheel_controller_output = _wheel_ctrl.control_bodyrate(dt, euler_angles.psi(), _groundspeed,
const float wheel_controller_output = _wheel_ctrl.control_bodyrate(dt, angular_velocity.xyz[2], _groundspeed,
groundspeed_scale);
wheel_u = wheel_control ? wheel_controller_output + _att_sp.yaw_sp_move_rate : 0.f;
}
Expand Down

0 comments on commit 03b4ad4

Please sign in to comment.