mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 18:13:35 +08:00
fill pressure altitude in global position from estimators
This commit is contained in:
@@ -1015,6 +1015,9 @@ void AttitudePositionEstimatorEKF::publishGlobalPosition()
|
|||||||
_global_pos.terrain_alt_valid = false;
|
_global_pos.terrain_alt_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* baro altitude */
|
||||||
|
_global_pos.pressure_alt = _baro_alt_filt;
|
||||||
|
|
||||||
_global_pos.yaw = _local_pos.yaw;
|
_global_pos.yaw = _local_pos.yaw;
|
||||||
|
|
||||||
const float dtLastGoodGPS = static_cast<float>(hrt_absolute_time() - _previousGPSTimestamp) / 1e6f;
|
const float dtLastGoodGPS = static_cast<float>(hrt_absolute_time() - _previousGPSTimestamp) / 1e6f;
|
||||||
|
|||||||
@@ -711,6 +711,7 @@ void BlockLocalPositionEstimator::publishGlobalPos()
|
|||||||
_pub_gpos.get().terrain_alt = 0;
|
_pub_gpos.get().terrain_alt = 0;
|
||||||
_pub_gpos.get().terrain_alt_valid = false;
|
_pub_gpos.get().terrain_alt_valid = false;
|
||||||
_pub_gpos.get().dead_reckoning = !_canEstimateXY && !_xyTimeout;
|
_pub_gpos.get().dead_reckoning = !_canEstimateXY && !_xyTimeout;
|
||||||
|
_pub_gpos.get().pressure_alt = _sub_sensor.get().baro_alt_meter[0];
|
||||||
_pub_gpos.update();
|
_pub_gpos.update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1336,6 +1336,8 @@ int position_estimator_inav_thread_main(int argc, char *argv[])
|
|||||||
global_pos.terrain_alt_valid = false;
|
global_pos.terrain_alt_valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
global_pos.pressure_alt = sensor.baro_alt_meter[0];
|
||||||
|
|
||||||
if (vehicle_global_position_pub == NULL) {
|
if (vehicle_global_position_pub == NULL) {
|
||||||
vehicle_global_position_pub = orb_advertise(ORB_ID(vehicle_global_position), &global_pos);
|
vehicle_global_position_pub = orb_advertise(ORB_ID(vehicle_global_position), &global_pos);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user