|
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "generated/airframe.h"#include "modules/sonar/sonar_adc.h"#include "modules/core/abi.h"#include "modules/datalink/telemetry.h"#include "pprzlink/messages.h"#include "mcu_periph/adc.h"#include "filters/low_pass_filter.h"
Include dependency graph for sonar_adc.c:Go to the source code of this file.
Macros | |
| #define | SONAR_ADC_MIN_RANGE 0.24f |
| The minimum chosen distance for the device to be give readings. | |
| #define | SONAR_ADC_MAX_RANGE 4.0f |
| The maximum chosen distance for the device to be give readings. | |
| #define | SONAR_ADC_RAW_OFFSET 0 |
| Sonar offset in ADC units. | |
| #define | SONAR_ADC_OFFSET 0.0f |
| Rangefinder distance offset value for what should be considered zero distance, e.g. | |
| #define | SONAR_ADC_USE_FILTER 1 |
| Filter the raw measuread sonar data. | |
| #define | USE_SONAR_ADC_AGL 0 |
| Option to send AGL data over ABI. | |
| #define | SONAR_ADC_LOWPASS_TAU 0.16 |
| #define | SONAR_ADC_COMPENSATE_ROTATION 0 |
| #define | SONAR_ADC_SCALE 0.001855f |
| Scale Sensor sensitivity in m/adc (float) | |
Functions | |
| static void | sonar_adc_send_sonar (struct transport_tx *trans, struct link_device *dev) |
| Sending Send measured value and status information so it can be read back in e.g. | |
| void | sonar_adc_init (void) |
| void | sonar_adc_periodic (void) |
| Reading Read ADC value to update sonar measurement. | |
| void | sonar_adc_report (void) |
| Debug report Option to send debug informative values over telemetry. | |
Variables | |
| static Butterworth2LowPass | sonar_filt |
| struct SonarADC | sonar_adc |
| static struct adc_buf | sonar_adc_buf |
| #define SONAR_ADC_COMPENSATE_ROTATION 0 |
Definition at line 97 of file sonar_adc.c.
| #define SONAR_ADC_LOWPASS_TAU 0.16 |
Definition at line 90 of file sonar_adc.c.
| #define SONAR_ADC_MAX_RANGE 4.0f |
The maximum chosen distance for the device to be give readings.
Definition at line 63 of file sonar_adc.c.
The minimum chosen distance for the device to be give readings.
Definition at line 58 of file sonar_adc.c.
| #define SONAR_ADC_OFFSET 0.0f |
Rangefinder distance offset value for what should be considered zero distance, e.g.
high landing gear of 1.1m to tarmac still could be considered zero This is NOT the same as the RAW ADC value offset
Definition at line 74 of file sonar_adc.c.
| #define SONAR_ADC_RAW_OFFSET 0 |
Sonar offset in ADC units.
Definition at line 68 of file sonar_adc.c.
Scale Sensor sensitivity in m/adc (float)
Definition at line 104 of file sonar_adc.c.
| #define SONAR_ADC_USE_FILTER 1 |
Filter the raw measuread sonar data.
Definition at line 79 of file sonar_adc.c.
| #define USE_SONAR_ADC_AGL 0 |
Option to send AGL data over ABI.
Definition at line 84 of file sonar_adc.c.
Definition at line 121 of file sonar_adc.c.
References adc_buf_channel(), DEFAULT_AV_NB_SAMPLE, DefaultPeriodic, SonarADC::distance, foo, init_butterworth_2_low_pass(), SonarADC::raw, register_periodic_telemetry(), SonarADC::scale, sonar_adc, sonar_adc_buf, SONAR_ADC_LOWPASS_TAU, SONAR_ADC_SCALE, sonar_adc_send_sonar(), sonar_filt, SonarADC::update_agl, and USE_SONAR_ADC_AGL.
Here is the call graph for this function:Reading Read ADC value to update sonar measurement.
Definition at line 145 of file sonar_adc.c.
References AGL_SONAR_ADC_ID, adc_buf::av_nb_sample, SonarADC::distance, foo, get_sys_time_usec(), FloatEulers::phi, SonarADC::raw, SonarADC::scale, sonar_adc, sonar_adc_buf, SONAR_ADC_MAX_RANGE, SONAR_ADC_MIN_RANGE, SONAR_ADC_OFFSET, SONAR_ADC_RAW_OFFSET, sonar_adc_report(), sonar_filt, stateGetNedToBodyEulers_f(), stateGetPositionEnu_f(), adc_buf::sum, FloatEulers::theta, SonarADC::update_agl, update_butterworth_2_low_pass(), and EnuCoor_f::z.
Here is the call graph for this function:Debug report Option to send debug informative values over telemetry.
Definition at line 207 of file sonar_adc.c.
References DefaultChannel, DefaultDevice, SonarADC::distance, foo, SonarADC::raw, and sonar_adc.
Referenced by sonar_adc_periodic().
Here is the caller graph for this function:
|
static |
Sending Send measured value and status information so it can be read back in e.g.
log file for debugging
Definition at line 116 of file sonar_adc.c.
References dev, SonarADC::distance, foo, SonarADC::raw, and sonar_adc.
Referenced by sonar_adc_init().
Here is the caller graph for this function:| struct SonarADC sonar_adc |
Definition at line 107 of file sonar_adc.c.
Referenced by sonar_adc_init(), sonar_adc_periodic(), sonar_adc_report(), sonar_adc_send_sonar(), and sonar_pwm_read().
|
static |
Definition at line 110 of file sonar_adc.c.
Referenced by sonar_adc_init(), and sonar_adc_periodic().
|
static |
Definition at line 92 of file sonar_adc.c.
Referenced by sonar_adc_init(), sonar_adc_periodic(), sonar_pwm_init(), and sonar_pwm_read().