AP_AHRS: add semaphore around set_origin

added semaphore around set_origin() to prevent thread racing
This commit is contained in:
CallanDaniel 2021-07-02 17:04:02 +02:00 committed by Randy Mackay
parent c34322f6ce
commit 396a27b17e

View File

@ -972,6 +972,7 @@ Vector2f AP_AHRS_NavEKF::groundspeed_vector(void)
// from which to decide the origin on its own
bool AP_AHRS_NavEKF::set_origin(const Location &loc)
{
WITH_SEMAPHORE(_rsem);
#if HAL_NAVEKF2_AVAILABLE
const bool ret2 = EKF2.setOriginLLH(loc);
#endif