fill pressure altitude in global position from estimators

This commit is contained in:
Andreas Antener 2015-11-23 16:17:07 +01:00
parent 11d9e3a325
commit c706c30e83
3 changed files with 6 additions and 0 deletions

View File

@ -1015,6 +1015,9 @@ void AttitudePositionEstimatorEKF::publishGlobalPosition()
_global_pos.terrain_alt_valid = false;
}
/* baro altitude */
_global_pos.pressure_alt = _baro_alt_filt;
_global_pos.yaw = _local_pos.yaw;
const float dtLastGoodGPS = static_cast<float>(hrt_absolute_time() - _previousGPSTimestamp) / 1e6f;

View File

@ -711,6 +711,7 @@ void BlockLocalPositionEstimator::publishGlobalPos()
_pub_gpos.get().terrain_alt = 0;
_pub_gpos.get().terrain_alt_valid = false;
_pub_gpos.get().dead_reckoning = !_canEstimateXY && !_xyTimeout;
_pub_gpos.get().pressure_alt = _sub_sensor.get().baro_alt_meter[0];
_pub_gpos.update();
}
}

View File

@ -1336,6 +1336,8 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
global_pos.terrain_alt_valid = false;
}
global_pos.pressure_alt = sensor.baro_alt_meter[0];
if (vehicle_global_position_pub == NULL) {
vehicle_global_position_pub = orb_advertise(ORB_ID(vehicle_global_position), &global_pos);