change INFRARED flag to USE_INFRARED

This commit is contained in:
Felix Ruess
2010-11-18 22:23:37 +01:00
parent 2c50106a60
commit 10a6f659fd
5 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -115,7 +115,7 @@
#define PERIODIC_SEND_SETTINGS(_chan) {} #define PERIODIC_SEND_SETTINGS(_chan) {}
#endif #endif
#if defined INFRARED || INFRARED_I2C #if defined USE_INFRARED || USE_INFRARED_I2C
#define PERIODIC_SEND_IR_SENSORS(_chan) DOWNLINK_SEND_IR_SENSORS(_chan, &ir_ir1, &ir_ir2, &ir_pitch, &ir_roll, &ir_top); #define PERIODIC_SEND_IR_SENSORS(_chan) DOWNLINK_SEND_IR_SENSORS(_chan, &ir_ir1, &ir_ir2, &ir_pitch, &ir_roll, &ir_top);
#else #else
#define PERIODIC_SEND_IR_SENSORS(_chan) ; #define PERIODIC_SEND_IR_SENSORS(_chan) ;
+1 -1
View File
@@ -20,7 +20,7 @@ void set_ir(double roll, double pitch) {
double ir_contrast = 150; //FIXME double ir_contrast = 150; //FIXME
double roll_sensor = roll + JSBSIM_IR_ROLL_NEUTRAL; // ir_roll_neutral; double roll_sensor = roll + JSBSIM_IR_ROLL_NEUTRAL; // ir_roll_neutral;
double pitch_sensor = pitch + JSBSIM_IR_PITCH_NEUTRAL; // ir_pitch_neutral; double pitch_sensor = pitch + JSBSIM_IR_PITCH_NEUTRAL; // ir_pitch_neutral;
#ifdef INFRARED #ifdef USE_INFRARED
ir_roll = sin(roll_sensor) * ir_contrast; ir_roll = sin(roll_sensor) * ir_contrast;
ir_pitch = sin(pitch_sensor) * ir_contrast; ir_pitch = sin(pitch_sensor) * ir_contrast;
ir_top = cos(roll_sensor) * cos(pitch_sensor) * ir_contrast; ir_top = cos(roll_sensor) * cos(pitch_sensor) * ir_contrast;
+1 -1
View File
@@ -21,7 +21,7 @@ value set_ir(value roll __attribute__ ((unused)),
value top __attribute__ ((unused)), value top __attribute__ ((unused)),
value air_speed value air_speed
) { ) {
#if defined INFRARED || INFRARED_I2C #if defined USE_INFRARED || USE_INFRARED_I2C
ir_roll = Int_val(roll); ir_roll = Int_val(roll);
ir_pitch = Int_val(front); ir_pitch = Int_val(front);
ir_top = Int_val(top); ir_top = Int_val(top);
+3 -3
View File
@@ -455,10 +455,10 @@ void periodic_task_ap( void ) {
gyro_update(); gyro_update();
#endif #endif
#ifdef INFRARED #ifdef USE_INFRARED
ir_update(); ir_update();
estimator_update_state_infrared(); estimator_update_state_infrared();
#endif /* INFRARED */ #endif /* USE_INFRARED */
h_ctl_attitude_loop(); /* Set h_ctl_aileron_setpoint & h_ctl_elevator_setpoint */ h_ctl_attitude_loop(); /* Set h_ctl_aileron_setpoint & h_ctl_elevator_setpoint */
v_ctl_throttle_slew(); v_ctl_throttle_slew();
ap_state->commands[COMMAND_THROTTLE] = v_ctl_throttle_slewed; ap_state->commands[COMMAND_THROTTLE] = v_ctl_throttle_slewed;
@@ -493,7 +493,7 @@ void init_ap( void ) {
#endif /* SINGLE_MCU */ #endif /* SINGLE_MCU */
/************* Sensors initialization ***************/ /************* Sensors initialization ***************/
#ifdef INFRARED #ifdef USE_INFRARED
ir_init(); ir_init();
#endif #endif
#ifdef GYRO #ifdef GYRO
+1 -1
View File
@@ -265,7 +265,7 @@ void parse_ugear_msg( void ){
ins_phi = (float)ugear_phi/10000 - ins_roll_neutral; ins_phi = (float)ugear_phi/10000 - ins_roll_neutral;
ins_psi = 0; ins_psi = 0;
ins_theta = (float)ugear_theta/10000 - ins_pitch_neutral; ins_theta = (float)ugear_theta/10000 - ins_pitch_neutral;
#ifndef INFRARED #ifndef USE_INFRARED
EstimatorSetAtt(ins_phi, ins_psi, ins_theta); EstimatorSetAtt(ins_phi, ins_psi, ins_theta);
#endif #endif
break; break;