Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional return control to predict_and_update_batch via return_result Parameter #48

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rednose/helpers/ekf_sym_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down