From dfe3af0b30698dd9e8559a91e9e1281e5afb78fc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 9 Dec 2013 14:11:03 +1100 Subject: [PATCH] SITL: update for compass API change --- libraries/AP_HAL_AVR_SITL/sitl_compass.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/AP_HAL_AVR_SITL/sitl_compass.cpp b/libraries/AP_HAL_AVR_SITL/sitl_compass.cpp index 3adaecb284..bfa7c7d9fa 100644 --- a/libraries/AP_HAL_AVR_SITL/sitl_compass.cpp +++ b/libraries/AP_HAL_AVR_SITL/sitl_compass.cpp @@ -40,9 +40,7 @@ void SITL_State::_update_compass(float rollDeg, float pitchDeg, float yawDeg) } _compass->setHIL(radians(rollDeg), radians(pitchDeg), radians(yawDeg)); Vector3f noise = _rand_vec3f() * _sitl->mag_noise; - _compass->mag_x += noise.x; - _compass->mag_y += noise.y; - _compass->mag_z += noise.z; + _compass->set_field(_compass->get_field() + noise); } #endif