fix the simple sim with imu based ahrs subsystems, use the ahrs_infrared subsystem for simulation

This commit is contained in:
Felix Ruess
2011-10-04 18:15:53 +02:00
parent b6b8052049
commit 321df6bedf
6 changed files with 71 additions and 9 deletions
@@ -3,11 +3,10 @@
# attitude estimation for fixedwings via dcm algorithm
$(TARGET).CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_float_dcm.h\"
$(TARGET).CFLAGS += -DUSE_AHRS_ALIGNER
ifeq ($(TARGET), ap)
ap.CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_float_dcm.h\"
ap.CFLAGS += -DUSE_AHRS_ALIGNER
ap.CFLAGS += -DUSE_AHRS
ap.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
@@ -37,7 +36,10 @@ ap.CFLAGS += -DAHRS_CORRECT_FREQUENCY=$(AHRS_CORRECT_FREQUENCY)
endif
# since there is currently no SITL sim for the Analog IMU, we use the infrared sim
# since there is currently no SITL sim for the IMU, we use the infrared sim
# and the ahrs_infrared subsystem
ifeq ($(TARGET), sim)
@@ -51,6 +53,13 @@ sim.srcs += subsystems/sensors/infrared_adc.c
sim.srcs += $(SRC_ARCH)/sim_ir.c
sim.srcs += $(SRC_ARCH)/sim_imu.c
sim.CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_infrared.h\"
sim.CFLAGS += -DUSE_AHRS
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_infrared.c
endif
jsbsim.srcs += $(SRC_ARCH)/jsbsim_ir.c
@@ -17,8 +17,32 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c
ap.CFLAGS += $(AHRS_CFLAGS)
ap.srcs += $(AHRS_SRCS)
sim.CFLAGS += $(AHRS_CFLAGS)
sim.srcs += $(AHRS_SRCS)
# since there is currently no ocaml SITL sim for the IMU, we use the infrared sim
# and the ahrs_infrared subsystem
ifeq ($(TARGET), sim)
sim.CFLAGS += -DIR_ROLL_NEUTRAL_DEFAULT=0
sim.CFLAGS += -DIR_PITCH_NEUTRAL_DEFAULT=0
sim.CFLAGS += -DUSE_INFRARED
sim.srcs += subsystems/sensors/infrared.c
sim.srcs += subsystems/sensors/infrared_adc.c
sim.srcs += $(SRC_ARCH)/sim_ir.c
sim.srcs += $(SRC_ARCH)/sim_imu.c
sim.CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_infrared.h\"
sim.CFLAGS += -DUSE_AHRS
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_infrared.c
endif
# Extra stuff for fixedwings
@@ -20,8 +20,31 @@ AHRS_SRCS += subsystems/ahrs/ahrs_aligner.c
ap.CFLAGS += $(AHRS_CFLAGS)
ap.srcs += $(AHRS_SRCS)
sim.CFLAGS += $(AHRS_CFLAGS)
sim.srcs += $(AHRS_SRCS)
# since there is currently no ocaml SITL sim for the IMU, we use the infrared sim
# and the ahrs_infrared subsystem
ifeq ($(TARGET), sim)
sim.CFLAGS += -DIR_ROLL_NEUTRAL_DEFAULT=0
sim.CFLAGS += -DIR_PITCH_NEUTRAL_DEFAULT=0
sim.CFLAGS += -DUSE_INFRARED
sim.srcs += subsystems/sensors/infrared.c
sim.srcs += subsystems/sensors/infrared_adc.c
sim.srcs += $(SRC_ARCH)/sim_ir.c
sim.srcs += $(SRC_ARCH)/sim_imu.c
sim.CFLAGS += -DAHRS_TYPE_H=\"subsystems/ahrs/ahrs_infrared.h\"
sim.CFLAGS += -DUSE_AHRS
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs.c
sim.srcs += $(SRC_SUBSYSTEMS)/ahrs/ahrs_infrared.c
endif
# Extra stuff for fixedwings
+1
View File
@@ -124,6 +124,7 @@
#endif
#if defined USE_INFRARED || USE_INFRARED_TELEMETRY
#include "subsystems/sensors/infrared.h"
#define PERIODIC_SEND_IR_SENSORS(_chan) DOWNLINK_SEND_IR_SENSORS(_chan, &infrared.value.ir1, &infrared.value.ir2, &infrared.pitch, &infrared.roll, &infrared.top);
#else
#define PERIODIC_SEND_IR_SENSORS(_chan) ;
-1
View File
@@ -6,7 +6,6 @@
#include <inttypes.h>
#include "subsystems/sensors/infrared.h"
#include "generated/airframe.h"
#include <caml/mlvalues.h>
@@ -25,6 +25,12 @@
#include "subsystems/ahrs.h"
#include "std.h"
// TODO: harmonize infrared neutrals with ins_neutrals
// or get rid of ins neutrals
// this ins only needed for sim right now
extern float ins_roll_neutral;
extern float ins_pitch_neutral;
extern void ahrs_update_gps(void);
extern void ahrs_update_infrared(void);