mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
ekf2: move gps yaw reset in starting function
This commit is contained in:
committed by
Mathieu Bresciani
parent
1461eb0e32
commit
9afc390552
@@ -820,10 +820,10 @@ void Ekf::controlGpsYawFusion(bool gps_checks_passing, bool gps_checks_failing)
|
|||||||
} else {
|
} else {
|
||||||
if (starting_conditions_passing) {
|
if (starting_conditions_passing) {
|
||||||
// Try to activate GPS yaw fusion
|
// Try to activate GPS yaw fusion
|
||||||
if (resetYawToGps()) {
|
startGpsYawFusion();
|
||||||
_control_status.flags.yaw_align = true;
|
|
||||||
|
if (_control_status.flags.gps_yaw) {
|
||||||
_nb_gps_yaw_reset_available = 1;
|
_nb_gps_yaw_reset_available = 1;
|
||||||
startGpsYawFusion();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1546,11 +1546,15 @@ void Ekf::stopGpsVelFusion()
|
|||||||
|
|
||||||
void Ekf::startGpsYawFusion()
|
void Ekf::startGpsYawFusion()
|
||||||
{
|
{
|
||||||
_control_status.flags.mag_dec = false;
|
if (resetYawToGps()) {
|
||||||
stopEvYawFusion();
|
_control_status.flags.yaw_align = true;
|
||||||
stopMagHdgFusion();
|
_control_status.flags.mag_dec = false;
|
||||||
stopMag3DFusion();
|
stopEvYawFusion();
|
||||||
_control_status.flags.gps_yaw = true;
|
stopMagHdgFusion();
|
||||||
|
stopMag3DFusion();
|
||||||
|
_control_status.flags.gps_yaw = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ekf::stopGpsYawFusion()
|
void Ekf::stopGpsYawFusion()
|
||||||
|
|||||||
Reference in New Issue
Block a user