paramsd: stricter checks on locationd yaw rate outputs

old-commit-hash: d6a575a8605130a59575ec7668e0d0eb90626595
This commit is contained in:
Willem Melching
2021-05-05 17:42:11 +02:00
parent 36534127aa
commit 2901659fe2
+3 -2
View File
@@ -34,13 +34,14 @@ class ParamsLearner:
def handle_log(self, t, which, msg):
if which == 'liveLocationKalman':
yaw_rate = msg.angularVelocityCalibrated.value[2]
yaw_rate_std = msg.angularVelocityCalibrated.std[2]
yaw_rate_valid = msg.angularVelocityCalibrated.valid
yaw_rate_valid = yaw_rate_valid and math.isfinite(yaw_rate)
yaw_rate_valid = yaw_rate_valid and math.isfinite(yaw_rate_std)
yaw_rate_valid = yaw_rate_valid and yaw_rate_std < 1e6
yaw_rate_valid = yaw_rate_valid and 0 < yaw_rate_std < 10 # rad/s
yaw_rate_valid = yaw_rate_valid and abs(yaw_rate) < 1 # rad/s
if self.active:
if msg.inputsOK and msg.posenetOK and yaw_rate_valid: