mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Added quaternion renormalization
This commit is contained in:
parent
cbcc124c71
commit
6b779275bc
@ -131,6 +131,8 @@ void ECL_FWAttControlVector::control(float dt, float airspeed, float airspeed_sc
|
||||
// XXX switch between operations based on difference,
|
||||
// benchmark both options
|
||||
math::Quaternion e_q = math::Quaternion(R_des) - math::Quaternion(R_bn);
|
||||
// Renormalize
|
||||
e_q = e_q / e_q.norm();
|
||||
math::Matrix e_R = math::Dcm(e_q);
|
||||
//small angles: math::Matrix e_R = (R_des.transpose() * R_bn - R_bn.transpose() * R_des) * 0.5f;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user