APM:Libraries
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
AP_RangeFinder_Bebop Class Reference

#include <AP_RangeFinder_Bebop.h>

Inheritance diagram for AP_RangeFinder_Bebop:
[legend]
Collaboration diagram for AP_RangeFinder_Bebop:
[legend]

Public Member Functions

 AP_RangeFinder_Bebop (RangeFinder::RangeFinder_State &_state)
 
 ~AP_RangeFinder_Bebop (void)
 
void update (void)
 
- Public Member Functions inherited from AP_RangeFinder_Backend
 AP_RangeFinder_Backend (RangeFinder::RangeFinder_State &_state)
 
virtual ~AP_RangeFinder_Backend (void)
 
virtual void handle_msg (mavlink_message_t *msg)
 
void update_pre_arm_check ()
 
enum Rotation orientation () const
 
uint16_t distance_cm () const
 
uint16_t voltage_mv () const
 
int16_t max_distance_cm () const
 
int16_t min_distance_cm () const
 
int16_t ground_clearance_cm () const
 
MAV_DISTANCE_SENSOR get_mav_distance_sensor_type () const
 
RangeFinder::RangeFinder_Status status () const
 
RangeFinder::RangeFinder_Type type () const
 
bool has_data () const
 
uint8_t range_valid_count () const
 
const Vector3fget_pos_offset () const
 

Static Public Member Functions

static bool detect ()
 

Protected Member Functions

virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type () const
 
- Protected Member Functions inherited from AP_RangeFinder_Backend
void update_status ()
 
void set_status (RangeFinder::RangeFinder_Status status)
 

Private Member Functions

void _init (void)
 
int _launch (void)
 
int _capture (void)
 
int _update_mode (float altitude)
 
void _configure_gpio (int value)
 
int _configure_wave ()
 
void _reconfigure_wave ()
 
int _configure_capture ()
 
int _launch_purge ()
 
void _loop (void)
 
unsigned short get_threshold_at (int i_capture)
 
int _apply_averaging_filter (void)
 
int _search_local_maxima (void)
 
int _search_maximum_with_max_amplitude (void)
 

Private Attributes

Linux::Thread_thread
 
AP_HAL::OwnPtr< AP_HAL::Device_spi
 
AP_HAL::GPIO_gpio
 
struct adc_capture _adc
 
struct iio_context * _iio
 
unsigned char _tx [2][RNFD_BEBOP_NB_PULSES_MAX]
 
unsigned char _purge [RNFD_BEBOP_NB_PULSES_PURGE]
 
unsigned char * _tx_buf
 
int _hysteresis_counter
 
const unsigned int threshold_echo_init = 1500
 
int _fd = -1
 
uint64_t _last_timestamp
 
int _mode
 
int _nb_echoes
 
int _freq
 
float _altitude
 
unsigned int * _filtered_capture
 
unsigned int _filtered_capture_size
 
struct echo _echoes [RNFD_BEBOP_MAX_ECHOES]
 
unsigned int _filter_average = 4
 
int16_t _last_max_distance_cm = 850
 
int16_t _last_min_distance_cm = 32
 

Additional Inherited Members

- Protected Attributes inherited from AP_RangeFinder_Backend
RangeFinder::RangeFinder_Statestate
 
AP_HAL::Semaphore_sem
 

Detailed Description

Definition at line 89 of file AP_RangeFinder_Bebop.h.

Constructor & Destructor Documentation

◆ AP_RangeFinder_Bebop()

AP_RangeFinder_Bebop::AP_RangeFinder_Bebop ( RangeFinder::RangeFinder_State _state)

◆ ~AP_RangeFinder_Bebop()

AP_RangeFinder_Bebop::~AP_RangeFinder_Bebop ( void  )

Member Function Documentation

◆ _apply_averaging_filter()

int AP_RangeFinder_Bebop::_apply_averaging_filter ( void  )
private

◆ _capture()

int AP_RangeFinder_Bebop::_capture ( void  )
private

◆ _configure_capture()

int AP_RangeFinder_Bebop::_configure_capture ( )
private

◆ _configure_gpio()

void AP_RangeFinder_Bebop::_configure_gpio ( int  value)
private

◆ _configure_wave()

int AP_RangeFinder_Bebop::_configure_wave ( )
private

◆ _get_mav_distance_sensor_type()

virtual MAV_DISTANCE_SENSOR AP_RangeFinder_Bebop::_get_mav_distance_sensor_type ( ) const
inlineprotectedvirtual

Implements AP_RangeFinder_Backend.

Definition at line 99 of file AP_RangeFinder_Bebop.h.

◆ _init()

void AP_RangeFinder_Bebop::_init ( void  )
private

◆ _launch()

int AP_RangeFinder_Bebop::_launch ( void  )
private

◆ _launch_purge()

int AP_RangeFinder_Bebop::_launch_purge ( )
private

◆ _loop()

void AP_RangeFinder_Bebop::_loop ( void  )
private

◆ _reconfigure_wave()

void AP_RangeFinder_Bebop::_reconfigure_wave ( )
private

◆ _search_local_maxima()

int AP_RangeFinder_Bebop::_search_local_maxima ( void  )
private

◆ _search_maximum_with_max_amplitude()

int AP_RangeFinder_Bebop::_search_maximum_with_max_amplitude ( void  )
private

◆ _update_mode()

int AP_RangeFinder_Bebop::_update_mode ( float  altitude)
private

◆ detect()

static bool AP_RangeFinder_Bebop::detect ( )
static

Referenced by RangeFinder::detect_instance().

Here is the caller graph for this function:

◆ get_threshold_at()

unsigned short AP_RangeFinder_Bebop::get_threshold_at ( int  i_capture)
private

◆ update()

void AP_RangeFinder_Bebop::update ( void  )
virtual

Member Data Documentation

◆ _adc

struct adc_capture AP_RangeFinder_Bebop::_adc
private

Definition at line 124 of file AP_RangeFinder_Bebop.h.

◆ _altitude

float AP_RangeFinder_Bebop::_altitude
private

Definition at line 137 of file AP_RangeFinder_Bebop.h.

◆ _echoes

struct echo AP_RangeFinder_Bebop::_echoes[RNFD_BEBOP_MAX_ECHOES]
private

Definition at line 140 of file AP_RangeFinder_Bebop.h.

◆ _fd

int AP_RangeFinder_Bebop::_fd = -1
private

Definition at line 132 of file AP_RangeFinder_Bebop.h.

◆ _filter_average

unsigned int AP_RangeFinder_Bebop::_filter_average = 4
private

Definition at line 141 of file AP_RangeFinder_Bebop.h.

◆ _filtered_capture

unsigned int* AP_RangeFinder_Bebop::_filtered_capture
private

Definition at line 138 of file AP_RangeFinder_Bebop.h.

◆ _filtered_capture_size

unsigned int AP_RangeFinder_Bebop::_filtered_capture_size
private

Definition at line 139 of file AP_RangeFinder_Bebop.h.

◆ _freq

int AP_RangeFinder_Bebop::_freq
private

Definition at line 136 of file AP_RangeFinder_Bebop.h.

◆ _gpio

AP_HAL::GPIO* AP_RangeFinder_Bebop::_gpio
private

Definition at line 122 of file AP_RangeFinder_Bebop.h.

◆ _hysteresis_counter

int AP_RangeFinder_Bebop::_hysteresis_counter
private

Definition at line 130 of file AP_RangeFinder_Bebop.h.

◆ _iio

struct iio_context* AP_RangeFinder_Bebop::_iio
private

Definition at line 125 of file AP_RangeFinder_Bebop.h.

◆ _last_max_distance_cm

int16_t AP_RangeFinder_Bebop::_last_max_distance_cm = 850
private

Definition at line 142 of file AP_RangeFinder_Bebop.h.

◆ _last_min_distance_cm

int16_t AP_RangeFinder_Bebop::_last_min_distance_cm = 32
private

Definition at line 143 of file AP_RangeFinder_Bebop.h.

◆ _last_timestamp

uint64_t AP_RangeFinder_Bebop::_last_timestamp
private

Definition at line 133 of file AP_RangeFinder_Bebop.h.

◆ _mode

int AP_RangeFinder_Bebop::_mode
private

Definition at line 134 of file AP_RangeFinder_Bebop.h.

◆ _nb_echoes

int AP_RangeFinder_Bebop::_nb_echoes
private

Definition at line 135 of file AP_RangeFinder_Bebop.h.

◆ _purge

unsigned char AP_RangeFinder_Bebop::_purge[RNFD_BEBOP_NB_PULSES_PURGE]
private

Definition at line 128 of file AP_RangeFinder_Bebop.h.

◆ _spi

AP_HAL::OwnPtr<AP_HAL::Device> AP_RangeFinder_Bebop::_spi
private

Definition at line 121 of file AP_RangeFinder_Bebop.h.

◆ _thread

Linux::Thread* AP_RangeFinder_Bebop::_thread
private

Definition at line 115 of file AP_RangeFinder_Bebop.h.

◆ _tx

unsigned char AP_RangeFinder_Bebop::_tx[2][RNFD_BEBOP_NB_PULSES_MAX]
private

Definition at line 127 of file AP_RangeFinder_Bebop.h.

◆ _tx_buf

unsigned char* AP_RangeFinder_Bebop::_tx_buf
private

Definition at line 129 of file AP_RangeFinder_Bebop.h.

◆ threshold_echo_init

const unsigned int AP_RangeFinder_Bebop::threshold_echo_init = 1500
private

Definition at line 131 of file AP_RangeFinder_Bebop.h.


The documentation for this class was generated from the following file: