Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/sonar/sonar_pwm.h"
#include "mcu_periph/pwm_input.h"
#include "subsystems/abi.h"
#include "filters/median_filter.h"
#include "subsystems/datalink/telemetry.h"
#include "pprzlink/messages.h"
#include "generated/airframe.h"
Go to the source code of this file.
Macros | |
#define | SONAR_OFFSET 0 |
The input channel of the PWM based sensor. More... | |
#define | SONAR_PWM_PERIOD 4096 |
Default to a 12 bit PWM sensor. More... | |
#define | SONAR_SCALE SONAR_PWM_PERIOD |
Ranger scale or sensitivity as you wish. More... | |
#define | SONAR_MEDIAN_SIZE 7 |
The Median Filter strength. More... | |
#define | SONAR_MIN_RANGE 0.15f |
The minimum range for the device to be able to measure. More... | |
#define | SONAR_MAX_RANGE 7.0f |
The maximum range for the device to be able to measure. More... | |
#define | SONAR_PWM_OFFSET 820 |
Some sensor may need an initial PWM offset (823 usec in the case of an EZ1 sensor) More... | |
#define | SENSOR_SYNC_SEND_SONAR TRUE |
Functions | |
void | sonar_pwm_init (void) |
void | sonar_pwm_read (void) |
Variables | |
struct SonarPwm | sonar_pwm |
#define SENSOR_SYNC_SEND_SONAR TRUE |
Definition at line 103 of file sonar_pwm.c.
#define SONAR_MAX_RANGE 7.0f |
The maximum range for the device to be able to measure.
Definition at line 93 of file sonar_pwm.c.
#define SONAR_MEDIAN_SIZE 7 |
The Median Filter strength.
Definition at line 83 of file sonar_pwm.c.
#define SONAR_MIN_RANGE 0.15f |
The minimum range for the device to be able to measure.
Definition at line 88 of file sonar_pwm.c.
#define SONAR_OFFSET 0 |
The input channel of the PWM based sensor.
Ranger offset value for what considered the distance should be zero
Definition at line 68 of file sonar_pwm.c.
#define SONAR_PWM_OFFSET 820 |
Some sensor may need an initial PWM offset (823 usec in the case of an EZ1 sensor)
Definition at line 98 of file sonar_pwm.c.
#define SONAR_PWM_PERIOD 4096 |
Default to a 12 bit PWM sensor.
Definition at line 73 of file sonar_pwm.c.
#define SONAR_SCALE SONAR_PWM_PERIOD |
Ranger scale or sensitivity as you wish.
Definition at line 78 of file sonar_pwm.c.
void sonar_pwm_init | ( | void | ) |
Definition at line 109 of file sonar_pwm.c.
References init_median_filter_f(), SonarPwm::offset, SonarPwm::raw, SonarPwm::scale, sonar_filt, SONAR_MEDIAN_SIZE, SONAR_OFFSET, sonar_pwm, and SONAR_SCALE.
void sonar_pwm_read | ( | void | ) |
Definition at line 120 of file sonar_pwm.c.
References AGL_SONAR_PWM_ID, DefaultChannel, DefaultDevice, SonarAdc::distance, SonarPwm::distance, get_pwm_input_duty_in_usec(), get_sys_time_usec(), SonarPwm::offset, FloatEulers::phi, SonarPwm::raw, SonarPwm::scale, sonar_adc, sonar_filt, SONAR_MAX_RANGE, SONAR_MIN_RANGE, sonar_pwm, SONAR_PWM_OFFSET, stateGetNedToBodyEulers_f(), stateGetPositionEnu_f(), FloatEulers::theta, update_median_filter_f(), and EnuCoor_f::z.
struct SonarPwm sonar_pwm |
Definition at line 106 of file sonar_pwm.c.
Referenced by sonar_pwm_init(), and sonar_pwm_read().