aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_att_pos_estimator/estimator.h
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-03-24 10:29:13 +0100
committerLorenz Meier <lm@inf.ethz.ch>2014-03-24 10:29:13 +0100
commit0022bbb5fbb0cd7237c9ce8b0006ec4ac0e14066 (patch)
tree7ac4c5607e8c7b72890831e2474fa9f0e56a189b /src/modules/fw_att_pos_estimator/estimator.h
parent8666ca53bf5b8eebbf60908c16273b711f80a19e (diff)
downloadpx4-firmware-0022bbb5fbb0cd7237c9ce8b0006ec4ac0e14066.tar.gz
px4-firmware-0022bbb5fbb0cd7237c9ce8b0006ec4ac0e14066.tar.bz2
px4-firmware-0022bbb5fbb0cd7237c9ce8b0006ec4ac0e14066.zip
Guard against invalid states
Diffstat (limited to 'src/modules/fw_att_pos_estimator/estimator.h')
-rw-r--r--src/modules/fw_att_pos_estimator/estimator.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/fw_att_pos_estimator/estimator.h b/src/modules/fw_att_pos_estimator/estimator.h
index 55e6eb12e..c5a5e9d8d 100644
--- a/src/modules/fw_att_pos_estimator/estimator.h
+++ b/src/modules/fw_att_pos_estimator/estimator.h
@@ -171,8 +171,18 @@ void quatNorm(float (&quatOut)[4], const float quatIn[4]);
// store staes along with system time stamp in msces
void StoreStates(uint64_t timestamp_ms);
-// recall stste vector stored at closest time to the one specified by msec
-void RecallStates(float statesForFusion[n_states], uint64_t msec);
+/**
+ * Recall the state vector.
+ *
+ * Recalls the vector stored at closest time to the one specified by msec
+ *
+ * @return zero on success, integer indicating the number of invalid states on failure.
+ * Does only copy valid states, if the statesForFusion vector was initialized
+ * correctly by the caller, the result can be safely used, but is a mixture
+ * time-wise where valid states were updated and invalid remained at the old
+ * value.
+ */
+int RecallStates(float statesForFusion[n_states], uint64_t msec);
void ResetStoredStates();