mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 23:04:07 +08:00
refactor start of gps into separate function
This commit is contained in:
parent
7eb2b08eed
commit
310b989c9a
@ -514,16 +514,7 @@ void Ekf::controlGpsFusion()
|
||||
|
||||
// If the heading is valid start using gps aiding
|
||||
if (_control_status.flags.yaw_align) {
|
||||
resetHorizontalPositionToGps();
|
||||
|
||||
// when adding with optical flow,
|
||||
// velocity reset is not necessary
|
||||
if (!_control_status.flags.opt_flow) {
|
||||
resetVelocityToGps();
|
||||
}
|
||||
|
||||
ECL_INFO_TIMESTAMPED("starting GPS fusion");
|
||||
_control_status.flags.gps = true;
|
||||
startGpsFusion();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -847,10 +847,9 @@ private:
|
||||
return sensor_timestamp + acceptance_interval > _time_last_imu;
|
||||
}
|
||||
|
||||
void startGpsFusion();
|
||||
void stopGpsFusion();
|
||||
|
||||
void stopGpsPosFusion();
|
||||
|
||||
void stopGpsVelFusion();
|
||||
|
||||
void startGpsYawFusion();
|
||||
|
||||
@ -1530,6 +1530,20 @@ void Ekf::loadMagCovData()
|
||||
P.slice<2, 2>(16, 16) = _saved_mag_ef_covmat;
|
||||
}
|
||||
|
||||
void Ekf::startGpsFusion()
|
||||
{
|
||||
resetHorizontalPositionToGps();
|
||||
|
||||
// when using optical flow,
|
||||
// velocity reset is not necessary
|
||||
if (!_control_status.flags.opt_flow) {
|
||||
resetVelocityToGps();
|
||||
}
|
||||
|
||||
ECL_INFO_TIMESTAMPED("starting GPS fusion");
|
||||
_control_status.flags.gps = true;
|
||||
}
|
||||
|
||||
void Ekf::stopGpsFusion()
|
||||
{
|
||||
stopGpsPosFusion();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user