Skip to content
Snippets Groups Projects
Commit 7aec94d4 authored by Paul Riseborough's avatar Paul Riseborough Committed by Dennis Mannhart
Browse files

ekf_att_pos_estimator: publish vertical position derivative

parent 4b7ae78f
No related branches found
No related tags found
No related merge requests found
......@@ -948,6 +948,9 @@ void AttitudePositionEstimatorEKF::publishLocalPosition()
_local_pos.vy = _ekf->states[5];
_local_pos.vz = _ekf->states[6];
// this estimator does not provide a separate vertical position time derivative estimate, so use the vertical velocity
_local_pos.z_deriv = _ekf->states[6];
_local_pos.xy_valid = _gps_initialized && _gpsIsGood;
_local_pos.z_valid = true;
_local_pos.v_xy_valid = _gps_initialized && _gpsIsGood;
......@@ -1016,11 +1019,13 @@ void AttitudePositionEstimatorEKF::publishGlobalPosition()
if (_local_pos.v_z_valid) {
_global_pos.vel_d = _local_pos.vz;
} else {
_global_pos.vel_d = 0.0f;
}
// this estimator does not provide a separate vertical position time derivative estimate, so use the vertical velocity
_global_pos.pos_d_deriv = _global_pos.vel_d;
/* terrain altitude */
if (_terrain_estimator->is_valid()) {
_global_pos.terrain_alt = _global_pos.alt - _terrain_estimator->get_distance_to_ground();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment