Aceinna / platform-aceinna_imu

Aceinna Navigation Studio: open-source, embedded development platform for Aceinna IMU hardware. Run custom algorithms and navigation code on Aceinna IMU/INS hardware
https://marketplace.visualstudio.com/items?itemName=platformio.aceinna-ide
36 stars 26 forks source link

Example, NovAtelGPS, _parseBestVelB_Fast Race Condition #18

Open jgladen opened 4 years ago

jgladen commented 4 years ago

in function _parseBestVelB_Fast

from file: platform-aceinna_imu/examples/OpenIMU300ZI/IMU/lib/Core/GPS/src/processNovAtelGPS.c

when solution status Non-ZERO (FIX WAS BAD) gpsFixType is set to potential non-zero this is inconsitant with bad fix

when solution status == ZERO (no problems, Fix is Good) gpsFixType is set to value zero (preventing fix use)

this was hard to find because of a race condition with the order of the BESTPOSB BESTVELB messages from Novatel hardware if BESTPOSB is processed after BESTVELB then gpsFixType is overwriten correctly if BESTVELB is processed after BESTPOSB then gpsFixType is overwriten in error