From b7395ee74b6962b8245a67b01bb766300d4a35f1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 20 Jun 2016 11:17:36 +1000 Subject: [PATCH] SITL: fixed sign of magnetic inclination --- libraries/SITL/SIM_Aircraft.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/SITL/SIM_Aircraft.cpp b/libraries/SITL/SIM_Aircraft.cpp index 154042576f..bfaabe22c3 100644 --- a/libraries/SITL/SIM_Aircraft.cpp +++ b/libraries/SITL/SIM_Aircraft.cpp @@ -167,7 +167,7 @@ void Aircraft::update_mag_field_bf() // create a field vector and rotate to the required orientation Vector3f mag_ef(1e3f * intensity, 0, 0); Matrix3f R; - R.from_euler(0, ToRad(inclination), ToRad(declination)); + R.from_euler(0, -ToRad(inclination), ToRad(declination)); mag_ef = R * mag_ef; // calculate frame height above ground