Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
jsbsim_ir.c
Go to the documentation of this file.
1 
8 #include "jsbsim_hw.h"
9 #include <math.h>
10 #include "estimator.h"
11 
12 #ifndef JSBSIM_IR_ROLL_NEUTRAL
13 #define JSBSIM_IR_ROLL_NEUTRAL 0.
14 #endif
15 #ifndef JSBSIM_IR_PITCH_NEUTRAL
16 #define JSBSIM_IR_PITCH_NEUTRAL 0.
17 #endif
18 
19 void set_ir(double roll __attribute__ ((unused)), double pitch __attribute__ ((unused))) {
20  // INFRARED_TELEMETRY : Stupid hack to use with modules
21 #if USE_INFRARED || USE_INFRARED_TELEMETRY
22  double ir_contrast = 150; //FIXME
23  double roll_sensor = roll + JSBSIM_IR_ROLL_NEUTRAL; // ir_roll_neutral;
24  double pitch_sensor = pitch + JSBSIM_IR_PITCH_NEUTRAL; // ir_pitch_neutral;
25  infrared.roll = sin(roll_sensor) * ir_contrast;
26  infrared.pitch = sin(pitch_sensor) * ir_contrast;
27  infrared.top = cos(roll_sensor) * cos(pitch_sensor) * ir_contrast;
28 #endif
29 }
30 
31 
32 void ir_gain_calib(void) {}
33 
35 void adc_buf_channel(uint8_t adc_channel __attribute__ ((unused)), struct adc_buf* s __attribute__ ((unused)), uint8_t av_nb_sample __attribute__ ((unused))) {}
struct Infrared infrared
Definition: infrared.c:36
int16_t roll
Definition: infrared.h:131
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
Definition: adc.h:60
void set_ir(double roll __attribute__((unused)), double pitch __attribute__((unused)))
Definition: jsbsim_ir.c:19
void ir_gain_calib(void)
Definition: jsbsim_ir.c:32
void adc_buf_channel(uint8_t adc_channel __attribute__((unused)), struct adc_buf *s __attribute__((unused)), uint8_t av_nb_sample __attribute__((unused)))
Required by infrared.c:ir_init()
Definition: jsbsim_ir.c:35
unsigned char uint8_t
Definition: types.h:14
#define JSBSIM_IR_PITCH_NEUTRAL
Definition: jsbsim_ir.c:16
State estimation, fusioning sensors.
int16_t pitch
Definition: infrared.h:132
int16_t top
Definition: infrared.h:133
__attribute__((always_inline))
Definition: i2c_arch.c:35
#define JSBSIM_IR_ROLL_NEUTRAL
Regroup functions to simulate autopilot/infrared.c.
Definition: jsbsim_ir.c:13