mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-17 23:32:07 +08:00
paramsd: stricter checks on locationd yaw rate outputs
old-commit-hash: d6a575a8605130a59575ec7668e0d0eb90626595
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user