mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
EKF: Fix bug causing incorrect initial roll when inverted
This commit is contained in:
parent
016695fc3e
commit
36affe3cd8
@ -265,7 +265,7 @@ bool Ekf::initialiseFilter(void)
|
||||
if (_delVel_sum.norm() > 0.001f) {
|
||||
_delVel_sum.normalize();
|
||||
pitch = asinf(_delVel_sum(0));
|
||||
roll = -asinf(_delVel_sum(1) / cosf(pitch));
|
||||
roll = atan2f(-_delVel_sum(1), -_delVel_sum(2));
|
||||
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user