diff --git a/sw/simulator/nps/nps_autopilot_rotorcraft.c b/sw/simulator/nps/nps_autopilot_rotorcraft.c index 11c2afe244..3796fddaf7 100644 --- a/sw/simulator/nps/nps_autopilot_rotorcraft.c +++ b/sw/simulator/nps/nps_autopilot_rotorcraft.c @@ -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(); diff --git a/sw/simulator/nps/nps_fdm_jsbsim.c b/sw/simulator/nps/nps_fdm_jsbsim.c index 2f389ea5cf..c2e5ebb95d 100644 --- a/sw/simulator/nps/nps_fdm_jsbsim.c +++ b/sw/simulator/nps/nps_fdm_jsbsim.c @@ -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 }