From cbd6a7e91f183f291a7800bcc2d146dba92adc1c Mon Sep 17 00:00:00 2001 From: Christophe De Wagter Date: Wed, 15 Dec 2010 14:04:30 +0100 Subject: [PATCH] Single Tuning File for all IMU Fixedwings --- conf/airframes/example_twog_analogimu.xml | 12 ++- .../fixedwing/attitude_dcm.makefile | 7 +- conf/conf.xml.example | 10 ++ conf/settings/tuning_analog_imu.xml | 100 ------------------ conf/settings/tuning_ins.xml | 7 +- .../arch/sim/{sim_analogimu.c => sim_imu.c} | 4 +- sw/airborne/subsystems/ahrs.h | 6 ++ sw/airborne/subsystems/ahrs/ahrs_float_dcm.c | 8 +- sw/airborne/subsystems/ahrs/ahrs_float_dcm.h | 4 +- 9 files changed, 41 insertions(+), 117 deletions(-) delete mode 100644 conf/settings/tuning_analog_imu.xml rename sw/airborne/arch/sim/{sim_analogimu.c => sim_imu.c} (67%) diff --git a/conf/airframes/example_twog_analogimu.xml b/conf/airframes/example_twog_analogimu.xml index 8b9264005a..a4cf652c0e 100644 --- a/conf/airframes/example_twog_analogimu.xml +++ b/conf/airframes/example_twog_analogimu.xml @@ -1,6 +1,10 @@ - -
- - +
+ +
diff --git a/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile b/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile index cdc8ee2bb7..36105077d8 100644 --- a/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile +++ b/conf/autopilot/subsystems/fixedwing/attitude_dcm.makefile @@ -1,8 +1,11 @@ # attitude estimation for fixedwings via dcm algorithm +$(TARGET).CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_float_dcm.h\" + ifeq ($(ARCH), lpc21) -ap.CFLAGS += -DUSE_ANALOG_IMU + +ap.CFLAGS += -DUSE_ANALOG_IMU ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c ap.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_aligner.c @@ -21,7 +24,7 @@ sim.CFLAGS += -DUSE_INFRARED sim.srcs += subsystems/sensors/infrared.c sim.srcs += $(SRC_ARCH)/sim_ir.c -sim.srcs += $(SRC_ARCH)/sim_analogimu.c +sim.srcs += $(SRC_ARCH)/sim_imu.c endif diff --git a/conf/conf.xml.example b/conf/conf.xml.example index 682645c290..5ba76d762e 100644 --- a/conf/conf.xml.example +++ b/conf/conf.xml.example @@ -80,6 +80,16 @@ settings="settings/basic.xml" gui_color="#6293ba" /> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/conf/settings/tuning_ins.xml b/conf/settings/tuning_ins.xml index 765dd2a6f5..fb7ac75c5d 100644 --- a/conf/settings/tuning_ins.xml +++ b/conf/settings/tuning_ins.xml @@ -32,7 +32,7 @@ - + @@ -66,8 +66,9 @@ - - + + + diff --git a/sw/airborne/arch/sim/sim_analogimu.c b/sw/airborne/arch/sim/sim_imu.c similarity index 67% rename from sw/airborne/arch/sim/sim_analogimu.c rename to sw/airborne/arch/sim/sim_imu.c index 0551d34890..0169091122 100644 --- a/sw/airborne/arch/sim/sim_analogimu.c +++ b/sw/airborne/arch/sim/sim_imu.c @@ -11,5 +11,5 @@ #include -float imu_roll_neutral = RadOfDeg(IMU_ROLL_NEUTRAL_DEFAULT); -float imu_pitch_neutral = RadOfDeg(IMU_PITCH_NEUTRAL_DEFAULT); +float ins_roll_neutral = INS_ROLL_NEUTRAL_DEFAULT; +float ins_pitch_neutral = INS_PITCH_NEUTRAL_DEFAULT; diff --git a/sw/airborne/subsystems/ahrs.h b/sw/airborne/subsystems/ahrs.h index c0d088fbb3..7d358b9288 100644 --- a/sw/airborne/subsystems/ahrs.h +++ b/sw/airborne/subsystems/ahrs.h @@ -33,6 +33,12 @@ #define AHRS_UNINIT 0 #define AHRS_RUNNING 1 +/* underlying includes (needed for parameters) */ +#ifdef AHRS_TYPE_H +#include AHRS_TYPE_H +#endif + + struct Ahrs { struct Int32Quat ltp_to_imu_quat; diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c index f88125ea39..62f21993a1 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c +++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.c @@ -40,8 +40,8 @@ struct AhrsFloatDCM ahrs_impl; // remotely settable -float imu_roll_neutral = RadOfDeg(IMU_ROLL_NEUTRAL_DEFAULT); -float imu_pitch_neutral = RadOfDeg(IMU_PITCH_NEUTRAL_DEFAULT); +float ins_roll_neutral = INS_ROLL_NEUTRAL_DEFAULT; +float ins_pitch_neutral = INS_PITCH_NEUTRAL_DEFAULT; // Axis definition: X axis pointing forward, Y axis pointing to the right and Z axis pointing down. // Positive pitch : nose up @@ -82,8 +82,8 @@ void ahrs_update_fw_estimator( void ) //compute_body_orientation_and_rates(); // export results to estimator - estimator_phi = ahrs_float.ltp_to_imu_euler.phi - imu_roll_neutral; - estimator_theta = ahrs_float.ltp_to_imu_euler.theta - imu_pitch_neutral; + estimator_phi = ahrs_float.ltp_to_imu_euler.phi - ins_roll_neutral; + estimator_theta = ahrs_float.ltp_to_imu_euler.theta - ins_pitch_neutral; estimator_psi = ahrs_float.ltp_to_imu_euler.psi; } diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h index 5ffb38854b..6bf2551539 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h +++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm.h @@ -37,8 +37,8 @@ struct AhrsFloatDCM { }; extern struct AhrsFloatDCM ahrs_impl; -extern float imu_roll_neutral; -extern float imu_pitch_neutral; +extern float ins_roll_neutral; +extern float ins_pitch_neutral; void ahrs_update_fw_estimator(void);