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

#include <AP_RangeFinder_NMEA.h>

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

Public Member Functions

 AP_RangeFinder_NMEA (RangeFinder::RangeFinder_State &_state, AP_SerialManager &serial_manager, uint8_t serial_instance)
 
void update (void) override
 
- 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 (AP_SerialManager &serial_manager, uint8_t serial_instance)
 

Protected Member Functions

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

Private Types

enum  sentence_types : uint8_t { SONAR_UNKNOWN = 0, SONAR_DBT, SONAR_DPT }
 enum for handled messages More...
 

Private Member Functions

bool get_reading (uint16_t &reading_cm)
 
bool decode (char c)
 
bool decode_latest_term ()
 

Static Private Member Functions

static int16_t char_to_hex (char a)
 

Private Attributes

AP_HAL::UARTDriveruart = nullptr
 
uint32_t _last_reading_ms
 
char _term [15]
 
uint8_t _term_offset
 
uint8_t _term_number
 
float _distance_m
 
uint8_t _checksum
 
bool _term_is_checksum
 
sentence_types _sentence_type
 

Additional Inherited Members

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

Detailed Description

Definition at line 21 of file AP_RangeFinder_NMEA.h.

Member Enumeration Documentation

◆ sentence_types

enum AP_RangeFinder_NMEA::sentence_types : uint8_t
private

enum for handled messages

Enumerator
SONAR_UNKNOWN 
SONAR_DBT 
SONAR_DPT 

Definition at line 45 of file AP_RangeFinder_NMEA.h.

Constructor & Destructor Documentation

◆ AP_RangeFinder_NMEA()

AP_RangeFinder_NMEA::AP_RangeFinder_NMEA ( RangeFinder::RangeFinder_State _state,
AP_SerialManager serial_manager,
uint8_t  serial_instance 
)

Definition at line 27 of file AP_RangeFinder_NMEA.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _get_mav_distance_sensor_type()

virtual MAV_DISTANCE_SENSOR AP_RangeFinder_NMEA::_get_mav_distance_sensor_type ( ) const
inlineoverrideprotectedvirtual

Implements AP_RangeFinder_Backend.

Definition at line 38 of file AP_RangeFinder_NMEA.h.

◆ char_to_hex()

int16_t AP_RangeFinder_NMEA::char_to_hex ( char  a)
staticprivate

Definition at line 178 of file AP_RangeFinder_NMEA.cpp.

Referenced by decode_latest_term().

Here is the caller graph for this function:

◆ decode()

bool AP_RangeFinder_NMEA::decode ( char  c)
private

Definition at line 89 of file AP_RangeFinder_NMEA.cpp.

Referenced by get_reading().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode_latest_term()

bool AP_RangeFinder_NMEA::decode_latest_term ( )
private

Definition at line 132 of file AP_RangeFinder_NMEA.cpp.

Referenced by decode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detect()

bool AP_RangeFinder_NMEA::detect ( AP_SerialManager serial_manager,
uint8_t  serial_instance 
)
static

Definition at line 40 of file AP_RangeFinder_NMEA.cpp.

Referenced by RangeFinder::detect_instance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_reading()

bool AP_RangeFinder_NMEA::get_reading ( uint16_t &  reading_cm)
private

Definition at line 59 of file AP_RangeFinder_NMEA.cpp.

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void AP_RangeFinder_NMEA::update ( void  )
overridevirtual

Implements AP_RangeFinder_Backend.

Definition at line 46 of file AP_RangeFinder_NMEA.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _checksum

uint8_t AP_RangeFinder_NMEA::_checksum
private

Definition at line 74 of file AP_RangeFinder_NMEA.h.

Referenced by decode(), and decode_latest_term().

◆ _distance_m

float AP_RangeFinder_NMEA::_distance_m
private

Definition at line 73 of file AP_RangeFinder_NMEA.h.

Referenced by decode(), decode_latest_term(), and get_reading().

◆ _last_reading_ms

uint32_t AP_RangeFinder_NMEA::_last_reading_ms
private

Definition at line 67 of file AP_RangeFinder_NMEA.h.

Referenced by update().

◆ _sentence_type

sentence_types AP_RangeFinder_NMEA::_sentence_type
private

Definition at line 76 of file AP_RangeFinder_NMEA.h.

Referenced by decode(), and decode_latest_term().

◆ _term

char AP_RangeFinder_NMEA::_term[15]
private

Definition at line 70 of file AP_RangeFinder_NMEA.h.

Referenced by decode(), and decode_latest_term().

◆ _term_is_checksum

bool AP_RangeFinder_NMEA::_term_is_checksum
private

Definition at line 75 of file AP_RangeFinder_NMEA.h.

Referenced by decode(), and decode_latest_term().

◆ _term_number

uint8_t AP_RangeFinder_NMEA::_term_number
private

Definition at line 72 of file AP_RangeFinder_NMEA.h.

Referenced by decode(), and decode_latest_term().

◆ _term_offset

uint8_t AP_RangeFinder_NMEA::_term_offset
private

Definition at line 71 of file AP_RangeFinder_NMEA.h.

Referenced by decode().

◆ uart

AP_HAL::UARTDriver* AP_RangeFinder_NMEA::uart = nullptr
private

Definition at line 66 of file AP_RangeFinder_NMEA.h.

Referenced by AP_RangeFinder_NMEA(), and get_reading().


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