[nps] use magnetic field from airframe file if defined there

make it possible to disable the bypassing of the ahrs via define
This commit is contained in:
Felix Ruess
2012-07-24 21:12:59 +02:00
parent 8754f04616
commit 2bcaefe9e1
2 changed files with 12 additions and 1 deletions
+5 -1
View File
@@ -37,11 +37,15 @@
struct NpsAutopilot autopilot;
bool_t nps_bypass_ahrs;
#ifndef NPS_BYPASS_AHRS
#define NPS_BYPASS_AHRS TRUE
#endif
void nps_autopilot_init(enum NpsRadioControlType type_rc, int num_rc_script, char* rc_dev) {
nps_radio_control_init(type_rc, num_rc_script, rc_dev);
nps_bypass_ahrs = TRUE;
nps_bypass_ahrs = NPS_BYPASS_AHRS;
main_init();
+7
View File
@@ -348,9 +348,16 @@ static void init_ltp(void) {
fdm.ltp_g.y = 0.;
fdm.ltp_g.z = 9.81;
#ifdef AHRS_H_X
#pragma message "Using magnetic field as defined in airframe file."
fdm.ltp_h.x = AHRS_H_X;
fdm.ltp_h.y = AHRS_H_Y;
fdm.ltp_h.z = AHRS_H_Z;
#else
fdm.ltp_h.x = 0.4912;
fdm.ltp_h.y = 0.1225;
fdm.ltp_h.z = 0.8624;
#endif
}