SITL: add some magnetometer offsets

this ensures the compass null_offset algorithm has some work to do in
autotest
This commit is contained in:
Andrew Tridgell 2012-02-14 11:15:27 +11:00
parent 9103f7688c
commit 273a974814

View File

@ -16,6 +16,10 @@
#include "desktop.h"
#include "util.h"
#define MAG_OFS_X 17.0
#define MAG_OFS_Y 125.0
#define MAG_OFS_Z -18.0
/*
given a magnetic heading, and roll, pitch, yaw values,
calculate consistent magnetometer components
@ -65,5 +69,5 @@ void sitl_update_compass(float heading, float roll, float pitch, float yaw)
ToRad(roll),
ToRad(pitch),
ToRad(yaw));
compass.setHIL(m.x, m.y, m.z);
compass.setHIL(m.x - MAG_OFS_X, m.y - MAG_OFS_Y, m.z - MAG_OFS_Z);
}