modules: lpe: push sensor status update to object; prioritize lidar readings over sonar

This commit is contained in:
TSC21
2018-01-14 22:52:41 +01:00
committed by Lorenz Meier
parent b512759336
commit ec1c37e1af
3 changed files with 42 additions and 21 deletions
@@ -79,8 +79,10 @@ void BlockLocalPositionEstimator::sonarCorrect()
if (sonarMeasure(y) != OK) { return; }
// do not use sonar if lidar is active
//if (_lidarInitialized && (_lidarFault < fault_lvl_disable)) { return; }
// do not use sonar if lidar is active and not faulty or timed out
if (_lidarUpdated
&& !(_sensorFault & SENSOR_LIDAR)
&& !(_sensorTimeout & SENSOR_LIDAR)) { return; }
// calculate covariance
float cov = _sub_sonar->get().covariance;