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