mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 23:53:33 +08:00
terrain_estimator: introduce quality metric in rng
This commit introduces a quality measure in the range data. It is used to properly decide whether to initialize the HAGL estimate on sensor data or MIN_HGT parameter, as well as in the decision of whether a 'fake' measurement should be published on the ground to allow for optical flow take-offs.
This commit is contained in:
committed by
Paul Riseborough
parent
3e05fd552e
commit
a12186c285
@@ -314,7 +314,7 @@ void EstimatorInterface::setAirspeedData(uint64_t time_usec, float true_airspeed
|
||||
}
|
||||
}
|
||||
|
||||
void EstimatorInterface::setRangeData(uint64_t time_usec, float data)
|
||||
void EstimatorInterface::setRangeData(uint64_t time_usec, float data, uint8_t quality)
|
||||
{
|
||||
if (!_initialised || _range_buffer_fail) {
|
||||
return;
|
||||
@@ -336,6 +336,7 @@ void EstimatorInterface::setRangeData(uint64_t time_usec, float data)
|
||||
rangeSample range_sample_new;
|
||||
range_sample_new.rng = data;
|
||||
range_sample_new.time_us = time_usec - _params.range_delay_ms * 1000;
|
||||
range_sample_new.quality = quality;
|
||||
_time_last_range = time_usec;
|
||||
|
||||
_range_buffer.push(range_sample_new);
|
||||
|
||||
Reference in New Issue
Block a user