- self.lat = nodeLat->getDoubleValue();
- self.lon = nodeLon->getDoubleValue();
- self.altFt = nodeAlt->getDoubleValue();
- self.heading = nodeHeading->getDoubleValue();
- self.velocityKt = nodeVelocity->getDoubleValue();
- self.verticalFps = nodeVerticalFps->getDoubleValue();
+ self.lat = nodeLat->getDoubleValue();
+ self.lon = nodeLon->getDoubleValue();
+ self.pressureAltFt = nodePressureAlt->getDoubleValue();
+ self.heading = nodeHeading->getDoubleValue();
+ self.velocityKt = nodeVelocity->getDoubleValue();
+ self.verticalFps = nodeVerticalFps->getDoubleValue();
+
+ /* radar altimeter provides a lot of spikes due to uneven terrain
+ * MK-VIII GPWS-spec requires smoothing the radar altitude with a
+ * 10second moving average. Likely the TCAS spec requires the same.
+ * => We use a cheap 10 second exponential average method.
+ */
+ const double SmoothingFactor = 0.3;
+ self.radarAltFt = nodeRadarAlt->getDoubleValue()*SmoothingFactor +
+ (1-SmoothingFactor)*self.radarAltFt;