1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-1434 - use degrees for rotation, fix Calibration gui

This commit is contained in:
Alessio Morale 2014-08-07 14:34:43 +02:00
parent 85be5ba7af
commit b6c053565e
2 changed files with 4 additions and 3 deletions

View File

@ -30,11 +30,11 @@
#include "openpilot.h"
#include "pios.h"
#include "CoordinateConversions.h"
#include "pios_math.h"
#if defined(PIOS_INCLUDE_GPS_UBX_PARSER)
#include "inc/UBX.h"
#include "inc/GPS.h"
#include "CoordinateConversions.h"
#include "auxmagsettings.h"
static float mag_bias[3] = { 0, 0, 0 };
@ -483,6 +483,7 @@ void load_mag_settings()
float rotz;
AuxMagSettingsmag_transformArrayGet((float *)a);
AuxMagSettingsOrientationGet(&rotz);
rotz = DEG2RAD(rotz);
rot_about_axis_z(rotz, b);
matrix_mult_3x3f(a, b, mag_transform);
AuxMagSettingsmag_biasArrayGet(mag_bias);

View File

@ -592,7 +592,7 @@ void SixPointCalibrationModel::save()
if (externalMagAvailable) {
AuxMagSettings::DataFields auxCalibrationData = auxMagSettings->getData();
// Note that Revo/AuxMag MAG_TRANSFORM_RxCx are interchangeable, an assertion at initialization enforces the structs are equal
for (int i = 0; i < RevoCalibration::MAG_TRANSFORM_R2C2; i++) {
for (int i = 0; i < RevoCalibration::MAG_TRANSFORM_NUMELEM; i++) {
auxCalibrationData.mag_transform[i] = result.auxMagSettingsData.mag_transform[i];
}
for (int i = 0; i < 3; i++) {