diff --git a/Makefile b/Makefile index b9a8e3b11f..8bcd194cb5 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ lib: cd $(LIB)/ocaml; $(MAKE) cd $(LIB)/perl; $(MAKE) -tools: +tools: lib cd $(TOOLS); make logalizer: lib @@ -73,10 +73,10 @@ fbw fly_by_wire: ap autopilot: cd $(AP); $(MAKE) all -upload_fbw: fbw +upload_fbw: hard_ac cd $(FBW); $(MAKE) upload -upload_ap: ap +upload_ap: hard_ac cd $(AP); $(MAKE) upload erase_fbw: @@ -107,7 +107,7 @@ receive: tmtc static_h : PAPARAZZI_HOME=`pwd` PAPARAZZI_SRC=`pwd` make -f Makefile.gen -ac_h : static_h +ac_h : tools static_h PAPARAZZI_HOME=`pwd` PAPARAZZI_SRC=`pwd` $(TOOLS)/gen_aircraft.out $(AIRCRAFT) sim_ac: ac_h sim_sitl @@ -135,4 +135,3 @@ clean: find . -name '*~' -exec rm -f {} \; dist_clean : clean - rm -fr var diff --git a/Makefile.ac b/Makefile.ac index 276cbd4e3a..3bb3cfa31f 100644 --- a/Makefile.ac +++ b/Makefile.ac @@ -32,7 +32,7 @@ FLIGHT_PLAN_XML=$(ACINCLUDE)/flight_plan.xml INFLIGHT_CALIB_H=$(ACINCLUDE)/inflight_calib.h all: $(AIRFRAME_H) $(RADIO_H) $(FLIGHT_PLAN_H) $(FLIGHT_PLAN_XML) $(INFLIGHT_CALIB_H) - echo $(AIRFRAME_H) $(CONF)/$(AIRFRAME) + $(AIRFRAME_H) : $(CONF)/$(AIRFRAME) $(CONF_XML) $(TOOLS)/gen_airframe.out $(AC_ID) $(AIRCRAFT) $< > /tmp/airframe.h diff --git a/Makefile.gen b/Makefile.gen index 514e25f85e..dc95c93f91 100644 --- a/Makefile.gen +++ b/Makefile.gen @@ -38,7 +38,9 @@ static: $(MESSAGES_H) $(UBX_PROTOCOL_H) $(FBW_MESSAGES_H) $(MESSAGES_H) : $(MESSAGES_XML) $(CONF_XML) test -d $(STATICINCLUDE) || mkdir -p $(STATICINCLUDE) - $(TOOLS)/gen_messages.out $< telemetry_ap > $@ + TMP_FILE=`mktemp`;\ + $(TOOLS)/gen_messages.out $< telemetry_ap > $$TMP_FILE;\ + mv $$TMP_FILE $@ chmod a+r $@ $(FBW_MESSAGES_H) : $(MESSAGES_XML) $(CONF_XML) diff --git a/conf/Makefile.avr b/conf/Makefile.avr index 7cbea63740..c8abf68580 100644 --- a/conf/Makefile.avr +++ b/conf/Makefile.avr @@ -74,8 +74,7 @@ $(TARGET).objs = $($(TARGET).srcs:%.c=$(OBJDIR)/%.o) all compile: $($(TARGET).objs) $(OBJDIR)/$(TARGET).elf echo $(OBJDIR) -load upload: check_fuses \ - $(TARGET).install +load upload: $(TARGET).install # diff --git a/conf/airframes/ladybug.xml b/conf/airframes/ladybug.xml index 024e1676fb..5b75edc894 100755 --- a/conf/airframes/ladybug.xml +++ b/conf/airframes/ladybug.xml @@ -3,6 +3,7 @@
+
@@ -21,12 +22,16 @@
- - + + + + + +
@@ -36,6 +41,7 @@ +
@@ -43,7 +49,7 @@ - +
diff --git a/conf/airframes/microjet1.xml b/conf/airframes/microjet1.xml index a2c2f7b1d7..5e3b62652d 100644 --- a/conf/airframes/microjet1.xml +++ b/conf/airframes/microjet1.xml @@ -26,7 +26,7 @@ - + diff --git a/conf/airframes/plaster1.xml b/conf/airframes/plaster1.xml index ba6bf15eca..ca5630e0ad 100755 --- a/conf/airframes/plaster1.xml +++ b/conf/airframes/plaster1.xml @@ -4,11 +4,12 @@
+
- + @@ -22,12 +23,16 @@
- - + + + + + +
@@ -37,6 +42,7 @@ +
@@ -44,9 +50,9 @@ - + - +
@@ -54,7 +60,7 @@
- + @@ -74,13 +80,13 @@
-
- +
+ - -
+ +
diff --git a/conf/airframes/twinstar3.xml b/conf/airframes/twinstar3.xml index 6f566ba2d7..86ddf12f7e 100755 --- a/conf/airframes/twinstar3.xml +++ b/conf/airframes/twinstar3.xml @@ -10,8 +10,8 @@ - - + +
diff --git a/conf/conf.xml b/conf/conf.xml index 754615a0a6..a3319e9a86 100644 --- a/conf/conf.xml +++ b/conf/conf.xml @@ -14,7 +14,7 @@ ac_id="1" airframe="airframes/twinstar1.xml" radio="radios/mc3030.xml" - flight_plan="flight_plans/muret4.xml" + flight_plan="flight_plans/muret_mini.xml" /> @@ -71,7 +71,7 @@ ac_id="8" airframe="airframes/ladybug.xml" radio="radios/mc3030.xml" - flight_plan="flight_plans/ricou_pla.xml" + flight_plan="flight_plans/ricou_vz.xml" /> diff --git a/conf/control_panel.xml b/conf/control_panel.xml index 6853df4b0b..313a1e794f 100644 --- a/conf/control_panel.xml +++ b/conf/control_panel.xml @@ -115,12 +115,11 @@ - + - + - @@ -147,7 +146,7 @@ - + @@ -159,6 +158,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/conf/flight_plans/muret_mini.xml b/conf/flight_plans/muret_mini.xml index 72f0637284..71342ecd01 100644 --- a/conf/flight_plans/muret_mini.xml +++ b/conf/flight_plans/muret_mini.xml @@ -4,11 +4,15 @@ - + + + - - + + + + @@ -16,13 +20,24 @@ - - - - - + + + + + + + + + + + + + + + + diff --git a/conf/messages.xml b/conf/messages.xml index 89f0b2f301..ddbce5cd0c 100644 --- a/conf/messages.xml +++ b/conf/messages.xml @@ -22,7 +22,7 @@ - + @@ -347,7 +347,7 @@ - + diff --git a/sw/airborne/autopilot/cam.c b/sw/airborne/autopilot/cam.c index 8387516df4..caa394b7b4 100755 --- a/sw/airborne/autopilot/cam.c +++ b/sw/airborne/autopilot/cam.c @@ -46,17 +46,22 @@ float phi_c, theta_c; float target_x, target_y; void cam_manual( void ) { - int16_t yaw = from_fbw.channels[RADIO_YAW]; - if (yaw > MIN_PPRZ_CAM || yaw < -MIN_PPRZ_CAM) { - phi_c += FLOAT_OF_PPRZ(yaw, 0, DELTA_ALPHA); - phi_c = Min(phi_c, MAX_CAM_ROLL); - phi_c = Max(phi_c, -MAX_CAM_ROLL); - } - int16_t pitch = from_fbw.channels[RADIO_PITCH]; - if (pitch > MIN_PPRZ_CAM || pitch < -MIN_PPRZ_CAM) { - theta_c += FLOAT_OF_PPRZ(pitch, 0, DELTA_ALPHA); - theta_c = Min(theta_c, MAX_CAM_PITCH); - theta_c = Max(theta_c, -MAX_CAM_PITCH); + to_fbw.channels[RADIO_GAIN1] = 0; + to_fbw.channels[RADIO_CALIB] = 0; + if (pprz_mode == PPRZ_MODE_AUTO2) { + static pprz_t cam_roll, cam_pitch; + int16_t yaw = from_fbw.channels[RADIO_YAW]; + if (yaw > MIN_PPRZ_CAM || yaw < -MIN_PPRZ_CAM) { + cam_roll += FLOAT_OF_PPRZ(yaw, 0, 300.); + cam_roll = TRIM_PPRZ(cam_roll); + } + int16_t pitch = from_fbw.channels[RADIO_PITCH]; + if (pitch > MIN_PPRZ_CAM || pitch < -MIN_PPRZ_CAM) { + cam_pitch += FLOAT_OF_PPRZ(pitch, 0, 300.); + cam_pitch = TRIM_PPRZ(cam_pitch); + } + to_fbw.channels[RADIO_GAIN1] = cam_roll; + to_fbw.channels[RADIO_CALIB] = cam_pitch; } } diff --git a/sw/airborne/autopilot/estimator.c b/sw/airborne/autopilot/estimator.c index 01b1976e5c..4ecf207d3f 100644 --- a/sw/airborne/autopilot/estimator.c +++ b/sw/airborne/autopilot/estimator.c @@ -129,6 +129,12 @@ void estimator_update_state_3DMG( void ) { // estimator_psi = ahrs_euler[2]; //} #else //NO_IMU + +float ir_roll_neutral = RadOfDeg(IR_ROLL_NEUTRAL_DEFAULT); +/** Initialized to \a IR_PITCH_NEUTRAL_DEFAULT. + * Changed with @@@@@ EST-CE QUE CA CHANGE @@@@@ */ +float ir_pitch_neutral = RadOfDeg(IR_PITCH_NEUTRAL_DEFAULT); + void estimator_update_state_infrared( void ) { float rad_of_ir = (ir_estim_mode == IR_ESTIM_MODE_ON && EstimatorIrGainIsCorrect()) ? estimator_rad_of_ir : ir_rad_of_ir; @@ -158,14 +164,14 @@ void estimator_update_state_infrared( void ) { printf(" degres_left %d angle_left %d degres_right %d angle_right %d correction %.2f \n", (index_left*15), angle_left, (index_right*15), angle_right, correction); ***/ - estimator_phi = rad_of_ir * ir_roll /*** + RadOfDeg( correction ) ***/; + estimator_phi = rad_of_ir * ir_roll - ir_roll_neutral /*** + RadOfDeg( correction ) ***/; - estimator_theta = rad_of_ir * ir_pitch; + estimator_theta = rad_of_ir * ir_pitch - ir_pitch_neutral; } #endif #define INIT_WEIGHT 100. /* The number of times the initial value has to be taken */ -#define RHO 0.999 /* The higher, the slower the estimation is changing */ +#define RHO 0.995 /* The higher, the slower the estimation is changing */ #define g 9.81 diff --git a/sw/airborne/autopilot/estimator.h b/sw/airborne/autopilot/estimator.h index 6f97d06d1b..c90c684e50 100644 --- a/sw/airborne/autopilot/estimator.h +++ b/sw/airborne/autopilot/estimator.h @@ -27,6 +27,9 @@ #include +extern float ir_roll_neutral; +extern float ir_pitch_neutral; + /* position in meters */ extern float estimator_x; extern float estimator_y; diff --git a/sw/airborne/autopilot/if_calib.c b/sw/airborne/autopilot/if_calib.c index e13535365d..894b07cb54 100644 --- a/sw/airborne/autopilot/if_calib.c +++ b/sw/airborne/autopilot/if_calib.c @@ -45,6 +45,7 @@ uint8_t inflight_calib_mode = IF_CALIB_MODE_NONE; static int16_t slider1_init, slider2_init; +#include "estimator.h" #include "inflight_calib.h" diff --git a/sw/airborne/autopilot/infrared.c b/sw/airborne/autopilot/infrared.c index 80bb15f9e1..a06c46e5fe 100644 --- a/sw/airborne/autopilot/infrared.c +++ b/sw/airborne/autopilot/infrared.c @@ -39,10 +39,6 @@ int16_t ir_pitch; int16_t ir_contrast = IR_DEFAULT_CONTRAST; /** Initialized to \a IR_DEFAULT_CONTRAST. * Changed with @@@@@ EST-CE QUE CA CHANGE @@@@@ */ -int16_t ir_roll_neutral = IR_ROLL_NEUTRAL_DEFAULT; -/** Initialized to \a IR_PITCH_NEUTRAL_DEFAULT. - * Changed with @@@@@ EST-CE QUE CA CHANGE @@@@@ */ -int16_t ir_pitch_neutral = IR_PITCH_NEUTRAL_DEFAULT; /** \def RadOfIrFromConstrast(c) * \brief Contrast measurement @@ -64,20 +60,15 @@ static struct adc_buf buf_ir2; /** Initialize \a ir with the \a IR_DEFAULT_CONTRAST \n * Initialize \a adc_buf_channel */ +#ifndef ADC_CHANNEL_IR_NB_SAMPLES +#define ADC_CHANNEL_IR_NB_SAMPLES DEFAULT_AV_NB_SAMPLE +#else +#warning " ADC_CHANNEL_IR_NB_SAMPLES"; +#endif void ir_init(void) { RadOfIrFromConstrast(IR_DEFAULT_CONTRAST); - #ifndef ADC_CHANNEL_IR1_NB_SAMPLE -/* set_buf_av_nb_sample(&buf_ir1, ADC_CHANNEL_IR1_NB_SAMPLE) */ - #define ADC_CHANNEL_IR1_NB_SAMPLE DEFAULT_AV_NB_SAMPLE - #endif - adc_buf_channel(ADC_CHANNEL_IR1, &buf_ir1, ADC_CHANNEL_IR1_NB_SAMPLE); -/* adc_buf_channel(ADC_CHANNEL_IR1, &buf_ir1); */ - #ifndef ADC_CHANNEL_IR2_NB_SAMPLE -/* set_buf_av_nb_sample(&buf_ir2, ADC_CHANNEL_IR2_NB_SAMPLE) */ - #define ADC_CHANNEL_IR2_NB_SAMPLE DEFAULT_AV_NB_SAMPLE - #endif - adc_buf_channel(ADC_CHANNEL_IR2, &buf_ir2, ADC_CHANNEL_IR2_NB_SAMPLE); -/* adc_buf_channel(ADC_CHANNEL_IR2, &buf_ir2); */ + adc_buf_channel(ADC_CHANNEL_IR1, &buf_ir1, ADC_CHANNEL_IR_NB_SAMPLES); + adc_buf_channel(ADC_CHANNEL_IR2, &buf_ir2, ADC_CHANNEL_IR_NB_SAMPLES); } /** \fn void ir_update(void) @@ -88,12 +79,12 @@ void ir_update(void) { #ifndef SIMUL int16_t x1_mean = buf_ir1.sum/buf_ir1.av_nb_sample; int16_t x2_mean = buf_ir2.sum/buf_ir2.av_nb_sample; - ir_roll = IR_RollOfIrs(x1_mean, x2_mean) - ir_roll_neutral; - ir_pitch = IR_PitchOfIrs(x1_mean, x2_mean) - ir_pitch_neutral; + ir_roll = IR_RollOfIrs(x1_mean, x2_mean) - IR_ADC_ROLL_NEUTRAL; + ir_pitch = IR_PitchOfIrs(x1_mean, x2_mean) - IR_ADC_PITCH_NEUTRAL; #else extern volatile int16_t simul_ir_roll, simul_ir_pitch; - ir_roll = simul_ir_roll - ir_roll_neutral; - ir_pitch = simul_ir_pitch - ir_pitch_neutral; + ir_roll = simul_ir_roll - IR_ADC_ROLL_NEUTRAL; + ir_pitch = simul_ir_pitch - IR_ADC_PITCH_NEUTRAL; #endif } diff --git a/sw/airborne/autopilot/infrared.h b/sw/airborne/autopilot/infrared.h index 0b0d195761..580c2a5960 100644 --- a/sw/airborne/autopilot/infrared.h +++ b/sw/airborne/autopilot/infrared.h @@ -32,8 +32,6 @@ extern int16_t ir_pitch; /* averaged pitch adc */ extern float ir_rad_of_ir; extern int16_t ir_contrast; -extern int16_t ir_roll_neutral; -extern int16_t ir_pitch_neutral; void ir_init(void); void ir_update(void); diff --git a/sw/airborne/autopilot/main.c b/sw/airborne/autopilot/main.c index 4f40a11329..612903b1c2 100644 --- a/sw/airborne/autopilot/main.c +++ b/sw/airborne/autopilot/main.c @@ -203,7 +203,7 @@ uint8_t ac_ident = AC_ID; /** \def PERIODIC_SEND_BAT() * @@@@@ A FIXER @@@@@ */ -#define PERIODIC_SEND_BAT() { uint16_t e = energy; DOWNLINK_SEND_BAT(&desired_gaz, &vsupply, &estimator_flight_time, &low_battery, &block_time, &stage_time, &e); } +#define PERIODIC_SEND_BAT() { int16_t e = energy; DOWNLINK_SEND_BAT(&desired_gaz, &vsupply, &estimator_flight_time, &low_battery, &block_time, &stage_time, &e); } /** \def EventPos(_cpt, _channel, _event) * @@@@@ A FIXER @@@@@ */ @@ -415,7 +415,7 @@ void navigation_task( void ) { if (pprz_mode == PPRZ_MODE_HOME) nav_home(); else if (pprz_mode == PPRZ_MODE_GPS_OUT_OF_ORDER) - nav_wihtout_gps(); + nav_without_gps(); else nav_update(); @@ -446,7 +446,7 @@ void navigation_task( void ) { if (low_battery || (!estimator_flight_time && !launch)) desired_gaz = 0; } - energy += (float)desired_gaz * (MILLIAMP_PER_PERCENT / MAX_PPRZ * 0.25/3600.); + energy += (float)desired_gaz * (MILLIAMP_PER_PERCENT / MAX_PPRZ * 0.25); } #define PERIOD (256. * 1024. / CLOCK / 1000000.) @@ -540,8 +540,8 @@ inline void periodic_task( void ) { to_fbw.channels[RADIO_PITCH] = desired_elevator; #endif - /* Code for camera stabilization, FIXME put that elsewhere */ - to_fbw.channels[RADIO_GAIN1] = TRIM_PPRZ(MAX_PPRZ/0.75*(-estimator_phi)); + /* Code for camera stabilization */ + cam_manual (); link_fbw_send(); break; diff --git a/sw/airborne/autopilot/nav.c b/sw/airborne/autopilot/nav.c index 5f5a914e03..2f2a79b42c 100644 --- a/sw/airborne/autopilot/nav.c +++ b/sw/airborne/autopilot/nav.c @@ -325,20 +325,20 @@ void nav_init(void) { * Just set attitude and gaz to failsafe values * to prevent the plane from crashing. */ -void nav_wihtout_gps(void) { +void nav_without_gps(void) { #ifdef SECTION_FAILSAFE lateral_mode = LATERAL_MODE_ROLL; nav_desired_roll = FAILSAFE_DEFAULT_ROLL; auto_pitch = FALSE; nav_pitch = FAILSAFE_DEFAULT_PITCH; vertical_mode = VERTICAL_MODE_AUTO_GAZ; - nav_desired_gaz = TRIM_UPPRZ(FAILSAFE_DEFAULT_GAZ*MAX_PPRZ); + nav_desired_gaz = TRIM_UPPRZ((FAILSAFE_DEFAULT_GAZ)*MAX_PPRZ); #else lateral_mode = LATERAL_MODE_ROLL; nav_desired_roll = 0; auto_pitch = FALSE; nav_pitch = 0; vertical_mode = VERTICAL_MODE_AUTO_GAZ; - nav_desired_gaz = TRIM_UPPRZ(CLIMB_LEVEL_GAZ*MAX_PPRZ); + nav_desired_gaz = TRIM_UPPRZ((CLIMB_LEVEL_GAZ)*MAX_PPRZ); #endif } diff --git a/sw/airborne/autopilot/nav.h b/sw/airborne/autopilot/nav.h index 8aab1ce188..8fa06a394e 100644 --- a/sw/airborne/autopilot/nav.h +++ b/sw/airborne/autopilot/nav.h @@ -76,6 +76,6 @@ extern uint8_t horizontal_mode; void nav_update(void); void nav_home(void); void nav_init(void); -void nav_wihtout_gps(void); +void nav_without_gps(void); #endif /* NAV_H */ diff --git a/sw/airborne/autopilot/pid.c b/sw/airborne/autopilot/pid.c index 5f0addbd5a..f8a77cac30 100644 --- a/sw/airborne/autopilot/pid.c +++ b/sw/airborne/autopilot/pid.c @@ -47,11 +47,13 @@ float pitch_of_roll = PITCH_OF_ROLL; float pitch_of_vz_pgain = CLIMB_PITCH_OF_VZ_PGAIN; float pitch_of_vz = 0.; +float aileron_of_gaz = AILERON_OF_GAZ; + /** \brief Computes ::desired_aileron and ::desired_elevator from attitude estimation and expected attitude. */ void roll_pitch_pid_run( void ) { float err = estimator_phi - desired_roll; - desired_aileron = TRIM_PPRZ(roll_pgain * err); + desired_aileron = TRIM_PPRZ(roll_pgain * err + desired_gaz * aileron_of_gaz); if (pitch_of_roll <0.) pitch_of_roll = 0.; err = -(estimator_theta - desired_pitch - pitch_of_roll * fabs(estimator_phi)); @@ -75,7 +77,6 @@ void course_pid_run( void ) { const float climb_pgain = CLIMB_PGAIN; const float climb_igain = CLIMB_IGAIN; float desired_climb = 0., pre_climb = 0.; -static const float level_gaz = CLIMB_LEVEL_GAZ; float climb_sum_err = 0; float climb_pitch_pgain = CLIMB_PITCH_PGAIN; @@ -84,8 +85,10 @@ float climb_pitch_sum_err = 0.; float max_pitch = MAX_PITCH; float min_pitch = MIN_PITCH; +float climb_level_gaz = CLIMB_LEVEL_GAZ; -#define MAX_CLIMB_SUM_ERR 100 + +#define MAX_CLIMB_SUM_ERR 150 #define MAX_PITCH_CLIMB_SUM_ERR 100 /** \brief Computes desired_gaz and updates nav_pitch from desired_climb */ @@ -107,7 +110,7 @@ climb_pid_run ( void ) { } else { /* pitch almost constant */ /* pitch offset for climb */ pitch_of_vz = (desired_climb > 0) ? desired_climb * pitch_of_vz_pgain : 0.; - float fgaz = climb_pgain * (err + climb_igain * climb_sum_err) + CLIMB_LEVEL_GAZ + CLIMB_GAZ_OF_CLIMB*desired_climb; + float fgaz = climb_pgain * (err + climb_igain * climb_sum_err) + climb_level_gaz + CLIMB_GAZ_OF_CLIMB*desired_climb; climb_sum_err += err; if (climb_sum_err > MAX_CLIMB_SUM_ERR) climb_sum_err = MAX_CLIMB_SUM_ERR; if (climb_sum_err < - MAX_CLIMB_SUM_ERR) climb_sum_err = - MAX_CLIMB_SUM_ERR; diff --git a/sw/airborne/autopilot/pid.h b/sw/airborne/autopilot/pid.h index 8f162a8191..c4689cb7ee 100644 --- a/sw/airborne/autopilot/pid.h +++ b/sw/airborne/autopilot/pid.h @@ -52,9 +52,11 @@ extern const float climb_igain; extern float climb_sum_err; extern float desired_climb, pre_climb; extern pprz_t desired_gaz, desired_aileron, desired_elevator; +extern float climb_level_gaz; extern float pitch_of_vz_pgain; extern float pitch_of_vz; +extern float aileron_of_gaz; void climb_pid_run(void); void altitude_pid_run(void); diff --git a/sw/airborne/fly_by_wire/imu.c b/sw/airborne/fly_by_wire/imu.c index d4aa9c0c7c..9c129b1942 100644 --- a/sw/airborne/fly_by_wire/imu.c +++ b/sw/airborne/fly_by_wire/imu.c @@ -80,12 +80,12 @@ void imu_init ( void ) { } void imu_update ( void ) { - raw_roll_dot = IMU_ADC_ROLL_DOT_SIGN * buf_roll_dot.sum; - raw_pitch_dot = IMU_ADC_PITCH_DOT_SIGN * buf_pitch_dot.sum; - raw_yaw_dot = IMU_ADC_YAW_DOT_SIGN * buf_yaw_dot.sum; - roll_dot = (int16_t)(raw_roll_dot - raw_roll_dot_neutral) / AV_NB_SAMPLE; - pitch_dot = (int16_t)(raw_pitch_dot - raw_pitch_dot_neutral) / AV_NB_SAMPLE; - yaw_dot = (int16_t)(raw_yaw_dot - raw_yaw_dot_neutral) / AV_NB_SAMPLE;; + raw_roll_dot = buf_roll_dot.sum; + raw_pitch_dot = buf_pitch_dot.sum; + raw_yaw_dot = buf_yaw_dot.sum; + roll_dot = IMU_ADC_ROLL_DOT_SIGN * (int16_t)(raw_roll_dot - raw_roll_dot_neutral) / AV_NB_SAMPLE; + pitch_dot = IMU_ADC_PITCH_DOT_SIGN * (int16_t)(raw_pitch_dot - raw_pitch_dot_neutral) / AV_NB_SAMPLE; + yaw_dot = IMU_ADC_YAW_DOT_SIGN * (int16_t)(raw_yaw_dot - raw_yaw_dot_neutral) / AV_NB_SAMPLE;; } void imu_capture_neutral ( void ) { diff --git a/sw/ground_segment/tmtc/Makefile b/sw/ground_segment/tmtc/Makefile index aaeefaab6c..494020a325 100644 --- a/sw/ground_segment/tmtc/Makefile +++ b/sw/ground_segment/tmtc/Makefile @@ -24,7 +24,8 @@ include ../../../conf/Makefile.local CONF = ../../../conf VAR = ../../../var -all: hw_modem_listen receive messages $(VAR)/boa.conf stereo_demod +all: hw_modem_listen receive messages $(VAR)/boa.conf +# stereo_demod clean: rm -f hw_modem_listen wavecard_connect receive messages *.bak *~ core *.o .depend *.opt *.out *.cm* diff --git a/sw/ground_segment/tmtc/receive.ml b/sw/ground_segment/tmtc/receive.ml index a4fa8e9414..d3fdc79ad3 100644 --- a/sw/ground_segment/tmtc/receive.ml +++ b/sw/ground_segment/tmtc/receive.ml @@ -162,7 +162,7 @@ type aircraft = { let aircrafts = Hashtbl.create 3 (** Broadcast of the received aircrafts *) -let aircraft_msg_period = 1000 (* ms *) +let aircraft_msg_period = 500 (* ms *) let send_aircrafts_msg = fun _asker _values -> assert(_values = []); let names = String.concat "," (Hashtbl.fold (fun k _v r -> k::r) aircrafts []) ^ "," in diff --git a/sw/simulator/sim_ir.c b/sw/simulator/sim_ir.c index eae0a6b04a..9e2f855150 100644 --- a/sw/simulator/sim_ir.c +++ b/sw/simulator/sim_ir.c @@ -14,8 +14,6 @@ int16_t ir_roll; int16_t ir_pitch; int16_t ir_contrast = IR_DEFAULT_CONTRAST; -int16_t ir_roll_neutral = IR_ROLL_NEUTRAL_DEFAULT; -int16_t ir_pitch_neutral = IR_PITCH_NEUTRAL_DEFAULT; float ir_rad_of_ir = IR_RAD_OF_IR_CONTRAST / IR_DEFAULT_CONTRAST; void ir_update(void) {