mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-16 13:02:27 +08:00
A valid livePose should not carry a timestamp produced from uninitialized Kalman filter time (#38124)
* locationd: require finite filter time for valid livePose * cast to bool and rename
This commit is contained in:
@@ -206,9 +206,11 @@ class LocationEstimator:
|
||||
self._finite_check(t, new_x, new_P)
|
||||
return HandleLogResult.SUCCESS
|
||||
|
||||
def get_msg(self, sensors_valid: bool, inputs_valid: bool, filter_valid: bool):
|
||||
def get_msg(self, sensors_valid: bool, inputs_valid: bool, filter_initialized: bool):
|
||||
state, cov = self.kf.x, self.kf.P
|
||||
std = np.sqrt(np.diag(cov))
|
||||
filter_time_valid = bool(np.isfinite(self.kf.t))
|
||||
filter_valid = filter_initialized and filter_time_valid
|
||||
|
||||
orientation_ned, orientation_ned_std = state[States.NED_ORIENTATION], std[States.NED_ORIENTATION]
|
||||
velocity_device, velocity_device_std = state[States.DEVICE_VELOCITY], std[States.DEVICE_VELOCITY]
|
||||
|
||||
Reference in New Issue
Block a user