From b55a8fb6226b654932180f7e10bff2816d91de64 Mon Sep 17 00:00:00 2001 From: deanlee Date: Wed, 11 Sep 2024 01:12:14 +0800 Subject: [PATCH] Explicit Parameter for Return Control --- rednose/helpers/ekf_sym_pyx.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rednose/helpers/ekf_sym_pyx.pyx b/rednose/helpers/ekf_sym_pyx.pyx index f552ea7..6a2f5e7 100644 --- a/rednose/helpers/ekf_sym_pyx.pyx +++ b/rednose/helpers/ekf_sym_pyx.pyx @@ -141,7 +141,7 @@ cdef class EKF_sym_pyx: def predict(self, double t): self.ekf.predict(t) - def predict_and_update_batch(self, double t, int kind, z, R, extra_args=[[]], bool augment=False): + def predict_and_update_batch(self, double t, int kind, z, R, extra_args=[[]], bool augment=False, bool return_result=False): cdef vector[MapVectorXd] z_map cdef np.ndarray[np.float64_t, ndim=1, mode='c'] zi_b for zi in z: @@ -163,7 +163,7 @@ cdef class EKF_sym_pyx: extra_args_map.push_back(args_map) cdef optional[Estimate] res = self.ekf.predict_and_update_batch(t, kind, z_map, R_map, extra_args_map, augment) - if not res.has_value(): + if not return_result or not res.has_value(): return None cdef VectorXd tmpvec