mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-01 13:38:38 -04:00
AC_AttitudeControl: Fix Angular velocity rotation to body frame
Thanks to BreederBai for higlighting this in issue #17059 Thanks to esaldiran and Hs293Go for helping check the math.
This commit is contained in:
parent
c12d1938c2
commit
c28d103afe
@ -619,7 +619,7 @@ void AC_AttitudeControl::attitude_controller_run_quat()
|
||||
// Add the angular velocity feedforward, rotated into vehicle frame
|
||||
Quaternion attitude_target_ang_vel_quat = Quaternion(0.0f, _attitude_target_ang_vel.x, _attitude_target_ang_vel.y, _attitude_target_ang_vel.z);
|
||||
Quaternion to_to_from_quat = attitude_vehicle_quat.inverse() * _attitude_target_quat;
|
||||
Quaternion desired_ang_vel_quat = to_to_from_quat.inverse() * attitude_target_ang_vel_quat * to_to_from_quat;
|
||||
Quaternion desired_ang_vel_quat = to_to_from_quat * attitude_target_ang_vel_quat * to_to_from_quat.inverse();
|
||||
|
||||
// Correct the thrust vector and smoothly add feedforward and yaw input
|
||||
_feedforward_scalar = 1.0f;
|
||||
|
Loading…
Reference in New Issue
Block a user