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

#include <AP_RangeFinder_LeddarOne.h>

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

Public Member Functions

 AP_RangeFinder_LeddarOne (RangeFinder::RangeFinder_State &_state, AP_SerialManager &serial_manager, uint8_t serial_instance)
 
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 (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 Member Functions

bool get_reading (uint16_t &reading_cm)
 
bool CRC16 (uint8_t *aBuffer, uint8_t aLength, bool aCheck)
 
LeddarOne_Status parse_response (uint8_t &number_detections)
 

Private Attributes

AP_HAL::UARTDriveruart = nullptr
 
uint32_t last_reading_ms
 
uint32_t last_sending_request_ms
 
uint32_t last_available_ms
 
uint16_t detections [LEDDARONE_DETECTIONS_MAX]
 
uint32_t sum_distance
 
LeddarOne_ModbusStatus modbus_status = LEDDARONE_MODBUS_STATE_INIT
 
uint8_t read_buffer [LEDDARONE_READ_BUFFER_SIZE]
 
uint32_t read_len
 
const uint8_t send_request_buffer [8]
 

Additional Inherited Members

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

Detailed Description

Definition at line 40 of file AP_RangeFinder_LeddarOne.h.

Constructor & Destructor Documentation

◆ AP_RangeFinder_LeddarOne()

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

Definition at line 27 of file AP_RangeFinder_LeddarOne.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _get_mav_distance_sensor_type()

virtual MAV_DISTANCE_SENSOR AP_RangeFinder_LeddarOne::_get_mav_distance_sensor_type ( ) const
inlineoverrideprotectedvirtual

Implements AP_RangeFinder_Backend.

Definition at line 57 of file AP_RangeFinder_LeddarOne.h.

Here is the call graph for this function:

◆ CRC16()

bool AP_RangeFinder_LeddarOne::CRC16 ( uint8_t *  aBuffer,
uint8_t  aLength,
bool  aCheck 
)
private

Definition at line 142 of file AP_RangeFinder_LeddarOne.cpp.

Referenced by _get_mav_distance_sensor_type(), and parse_response().

Here is the caller graph for this function:

◆ detect()

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

Definition at line 43 of file AP_RangeFinder_LeddarOne.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_LeddarOne::get_reading ( uint16_t &  reading_cm)
private

Definition at line 49 of file AP_RangeFinder_LeddarOne.cpp.

Referenced by _get_mav_distance_sensor_type(), and update().

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

◆ parse_response()

LeddarOne_Status AP_RangeFinder_LeddarOne::parse_response ( uint8_t &  number_detections)
private

Definition at line 191 of file AP_RangeFinder_LeddarOne.cpp.

Referenced by _get_mav_distance_sensor_type(), and get_reading().

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

◆ update()

void AP_RangeFinder_LeddarOne::update ( void  )
virtual

Implements AP_RangeFinder_Backend.

Definition at line 127 of file AP_RangeFinder_LeddarOne.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ detections

uint16_t AP_RangeFinder_LeddarOne::detections[LEDDARONE_DETECTIONS_MAX]
private

Definition at line 76 of file AP_RangeFinder_LeddarOne.h.

Referenced by parse_response().

◆ last_available_ms

uint32_t AP_RangeFinder_LeddarOne::last_available_ms
private

Definition at line 74 of file AP_RangeFinder_LeddarOne.h.

Referenced by get_reading().

◆ last_reading_ms

uint32_t AP_RangeFinder_LeddarOne::last_reading_ms
private

Definition at line 72 of file AP_RangeFinder_LeddarOne.h.

Referenced by update().

◆ last_sending_request_ms

uint32_t AP_RangeFinder_LeddarOne::last_sending_request_ms
private

Definition at line 73 of file AP_RangeFinder_LeddarOne.h.

Referenced by get_reading().

◆ modbus_status

LeddarOne_ModbusStatus AP_RangeFinder_LeddarOne::modbus_status = LEDDARONE_MODBUS_STATE_INIT
private

Definition at line 79 of file AP_RangeFinder_LeddarOne.h.

Referenced by get_reading().

◆ read_buffer

uint8_t AP_RangeFinder_LeddarOne::read_buffer[LEDDARONE_READ_BUFFER_SIZE]
private

Definition at line 80 of file AP_RangeFinder_LeddarOne.h.

Referenced by get_reading(), and parse_response().

◆ read_len

uint32_t AP_RangeFinder_LeddarOne::read_len
private

Definition at line 81 of file AP_RangeFinder_LeddarOne.h.

Referenced by get_reading(), and parse_response().

◆ send_request_buffer

const uint8_t AP_RangeFinder_LeddarOne::send_request_buffer[8]
private

◆ sum_distance

uint32_t AP_RangeFinder_LeddarOne::sum_distance
private

Definition at line 77 of file AP_RangeFinder_LeddarOne.h.

Referenced by get_reading(), and parse_response().

◆ uart

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

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