Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
sonar_adc.h File Reference

Driver for an sonar rangfinder sensor when used via an ADC channel. More...

#include "std.h"
+ Include dependency graph for sonar_adc.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SonarADC
 

Functions

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

struct SonarADC sonar_adc
 

Detailed Description

Driver for an sonar rangfinder sensor when used via an ADC channel.

Driver module for an analog rangefinder sensor connected to an ADC channel.

This module reads the ADC values from a rangefinder sensor and converts those values to a distance in meters or fractions thereof.

Options include:

  • Using a low-pass filter to smooth the distance output
  • Updating AGL (Above Ground Level) in the state with the distance value.
  • Rotation compensation, which compensates the AGL distance based on the current attitude of the aircraft.
  • Use sensor simulation SITL (Software In The Loop).
  • Sending periodic telemetry debug messages with the raw ADC value and the calculated distance.

Definition in file sonar_adc.h.


Data Structure Documentation

◆ SonarADC

struct SonarADC

Definition at line 41 of file sonar_adc.h.

Data Fields
float distance Distance measured in meters.
uint16_t raw raw measuread non scaled range value from sensor
float scale Scaling factor to convert raw value to a distance in SI unit (meters)
bool update_agl Do or don't update AGL ABI message.

Function Documentation

◆ sonar_adc_init()

◆ sonar_adc_periodic()

◆ sonar_adc_report()

void sonar_adc_report ( void  )
extern

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:

Variable Documentation

◆ sonar_adc

struct SonarADC sonar_adc
extern