SITL: add some magnetometer offsets
this ensures the compass null_offset algorithm has some work to do in autotest
This commit is contained in:
parent
9103f7688c
commit
273a974814
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user