AP_ExternalAHRS: Only use GPS data when populating GPS fields

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
This commit is contained in:
Ryan Friedman 2024-03-23 18:24:28 -06:00 committed by Randy Mackay
parent 28975fff27
commit 5405dff072

View File

@ -219,20 +219,20 @@ void AP_ExternalAHRS_MicroStrain7::post_filter() const
hdop: gnss_data[instance].hdop, hdop: gnss_data[instance].hdop,
vdop: gnss_data[instance].vdop, vdop: gnss_data[instance].vdop,
longitude: filter_data.lon, longitude: gnss_data[instance].lon,
latitude: filter_data.lat, latitude: gnss_data[instance].lat,
msl_altitude: gnss_data[instance].msl_altitude, msl_altitude: gnss_data[instance].msl_altitude,
ned_vel_north: filter_data.ned_velocity_north, ned_vel_north: gnss_data[instance].ned_velocity_north,
ned_vel_east: filter_data.ned_velocity_east, ned_vel_east: gnss_data[instance].ned_velocity_east,
ned_vel_down: filter_data.ned_velocity_down, ned_vel_down: gnss_data[instance].ned_velocity_down,
}; };
// *INDENT-ON* // *INDENT-ON*
if (gps.fix_type >= 3 && !state.have_origin) { if (gps.fix_type >= 3 && !state.have_origin) {
WITH_SEMAPHORE(state.sem); WITH_SEMAPHORE(state.sem);
state.origin = Location{int32_t(filter_data.lat), state.origin = Location{int32_t(gnss_data[instance].lat),
int32_t(filter_data.lon), int32_t(gnss_data[instance].lon),
int32_t(gnss_data[instance].msl_altitude), int32_t(gnss_data[instance].msl_altitude),
Location::AltFrame::ABSOLUTE}; Location::AltFrame::ABSOLUTE};
state.have_origin = true; state.have_origin = true;