Difference between GPS Altitude vs. Fused Altiude Estimation

Hi, could someone help understand what is the difference of these two in the flight log(GPS altitude/Fused Altitude estimation), when I already set EKF2_HGT_Mode to GPS?

My understanding is if I use GPS as the primary height source, the fused altitude would use the GPS_RAW_INT data, however, my flight log shows the height reported by GPS and Fused one are different sometime.

Hi, the fused altitude is the output from the state estimator so it will not only use the raw GPS data but also accelerometer etc.

CarlOlsson has pretty much nailed it. The reason is that many GPS’s only update once per second (and high end GNSS devices update 5-10 times per second) and is often only accurate to +/-1m in good conditions.

The state estimator is using the other sensors to to fill in the gaps between the 1 second GPS updates as well as improve accuracy.

Thanks for the answer!

As you suggested, I check the EFK2 source and seems this part maybe how they are fused?

float EKF2::filter_altitude_ellipsoid(float amsl_hgt)
	float height_diff = static_cast<float>(_gps_alttitude_ellipsoid) * 1e-3f - amsl_hgt;

	if (_gps_alttitude_ellipsoid_previous_timestamp == 0) {

		_wgs84_hgt_offset = height_diff;
		_gps_alttitude_ellipsoid_previous_timestamp = _gps_time_usec;

	} else if (_gps_time_usec != _gps_alttitude_ellipsoid_previous_timestamp) {

		// apply a 10 second first order low pass filter to baro offset
		float dt = 1e-6f * (_gps_time_usec - _gps_alttitude_ellipsoid_previous_timestamp);
		_gps_alttitude_ellipsoid_previous_timestamp = _gps_time_usec;
		float offset_rate_correction = 0.1f * (height_diff - _wgs84_hgt_offset);
		_wgs84_hgt_offset += dt * constrain(offset_rate_correction, -0.1f, 0.1f);

	return amsl_hgt + _wgs84_hgt_offset;

No it is here

1 Like