I'm trying to get the positions of the anchors, but calling the locoDeckGetAnchorPosition like this seems o make the software crash. The the console repeats ESTKALMAN: state out of bounds, resetting. Why does retrieving the anchor positions make the kalman filter crash?
The "ESTKALMAN: state out of bounds, resetting" message is displayed when the kalman estimator have an unreasonable view of the where the Crazyflie is or move (weird position or high velocity). It might happen if the kalman estimator don't get any sensor data for instance.
The locoDeckGetAnchorPosition() function uses a mutex to avoid problems when called from the memory sub system. If you call locoDeckGetAnchorPosition() from the task in locodeck.c and the mutex already is taken, you will hang the LPS deck task. Could this be the problem?
If you hang the task in the locodeck.c file, the LPS deck will stop ranging (the LEDs will stop blinking) and no measurements will be sent to the kalman estimator, resulting in a "ESTKALMAN: state out of bounds, resetting".