mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 02:38:07 +08:00
[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:
@@ -37,11 +37,15 @@
|
|||||||
struct NpsAutopilot autopilot;
|
struct NpsAutopilot autopilot;
|
||||||
bool_t nps_bypass_ahrs;
|
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) {
|
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_radio_control_init(type_rc, num_rc_script, rc_dev);
|
||||||
nps_bypass_ahrs = TRUE;
|
nps_bypass_ahrs = NPS_BYPASS_AHRS;
|
||||||
|
|
||||||
main_init();
|
main_init();
|
||||||
|
|
||||||
|
|||||||
@@ -348,9 +348,16 @@ static void init_ltp(void) {
|
|||||||
fdm.ltp_g.y = 0.;
|
fdm.ltp_g.y = 0.;
|
||||||
fdm.ltp_g.z = 9.81;
|
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.x = 0.4912;
|
||||||
fdm.ltp_h.y = 0.1225;
|
fdm.ltp_h.y = 0.1225;
|
||||||
fdm.ltp_h.z = 0.8624;
|
fdm.ltp_h.z = 0.8624;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user