PX4 Firmware
PX4 Autopilot Software http://px4.io
LidarLite Class Referenceabstract

#include <LidarLite.h>

Inheritance diagram for LidarLite:
Collaboration diagram for LidarLite:

Public Member Functions

 LidarLite (const uint8_t rotation=distance_sensor_s::ROTATION_DOWNWARD_FACING)
 
virtual ~LidarLite ()
 
virtual int init ()=0
 
virtual void start ()=0
 
virtual void stop ()=0
 
void print_info ()
 Diagnostics - print some basic information about the driver. More...
 
virtual void print_registers ()
 print registers to console. More...
 

Protected Member Functions

uint32_t get_measure_interval () const
 
virtual int collect ()=0
 
virtual int measure ()=0
 
virtual int reset_sensor ()
 

Protected Attributes

PX4Rangefinder _px4_rangefinder
 
perf_counter_t _comms_errors {perf_alloc(PC_COUNT, "ll40ls: comms errors")}
 
perf_counter_t _sample_perf {perf_alloc(PC_ELAPSED, "ll40ls: read")}
 
perf_counter_t _sensor_resets {perf_alloc(PC_COUNT, "ll40ls: resets")}
 
perf_counter_t _sensor_zero_resets {perf_alloc(PC_COUNT, "ll40ls: zero resets")}
 

Private Attributes

uint32_t _measure_interval {LL40LS_CONVERSION_INTERVAL}
 

Detailed Description

Definition at line 60 of file LidarLite.h.

Constructor & Destructor Documentation

◆ LidarLite()

LidarLite::LidarLite ( const uint8_t  rotation = distance_sensor_s::ROTATION_DOWNWARD_FACING)

Definition at line 44 of file LidarLite.cpp.

References _px4_rangefinder, LL40LS_MAX_DISTANCE, LL40LS_MIN_DISTANCE, PX4Rangefinder::set_fov(), PX4Rangefinder::set_max_distance(), and PX4Rangefinder::set_min_distance().

Here is the call graph for this function:

◆ ~LidarLite()

LidarLite::~LidarLite ( )
virtual

Definition at line 52 of file LidarLite.cpp.

References _comms_errors, _sample_perf, _sensor_resets, _sensor_zero_resets, and perf_free().

Here is the call graph for this function:

Member Function Documentation

◆ collect()

virtual int LidarLite::collect ( )
protectedpure virtual

Implemented in LidarLiteI2C, and LidarLitePWM.

◆ get_measure_interval()

uint32_t LidarLite::get_measure_interval ( ) const
inlineprotected

Definition at line 82 of file LidarLite.h.

Referenced by print_info(), LidarLiteI2C::Run(), and LidarLitePWM::start().

Here is the caller graph for this function:

◆ init()

virtual int LidarLite::init ( )
pure virtual

Implemented in LidarLiteI2C, and LidarLitePWM.

Referenced by ll40ls::start_bus(), and ll40ls::start_pwm().

Here is the caller graph for this function:

◆ measure()

virtual int LidarLite::measure ( )
protectedpure virtual

Implemented in LidarLiteI2C, and LidarLitePWM.

◆ print_info()

void LidarLite::print_info ( )

Diagnostics - print some basic information about the driver.

Definition at line 61 of file LidarLite.cpp.

References _comms_errors, _sample_perf, _sensor_resets, _sensor_zero_resets, get_measure_interval(), and perf_print_counter().

Referenced by ll40ls::status().

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

◆ print_registers()

virtual void LidarLite::print_registers ( )
inlinevirtual

print registers to console.

Reimplemented in LidarLiteI2C.

Definition at line 78 of file LidarLite.h.

Referenced by ll40ls::print_regs().

Here is the caller graph for this function:

◆ reset_sensor()

virtual int LidarLite::reset_sensor ( )
inlineprotectedvirtual

Reimplemented in LidarLiteI2C.

Definition at line 88 of file LidarLite.h.

Referenced by LidarLitePWM::measure().

Here is the caller graph for this function:

◆ start()

virtual void LidarLite::start ( )
pure virtual

Implemented in LidarLiteI2C, and LidarLitePWM.

Referenced by ll40ls::start_bus(), and ll40ls::start_pwm().

Here is the caller graph for this function:

◆ stop()

virtual void LidarLite::stop ( )
pure virtual

Implemented in LidarLiteI2C, and LidarLitePWM.

Member Data Documentation

◆ _comms_errors

perf_counter_t LidarLite::_comms_errors {perf_alloc(PC_COUNT, "ll40ls: comms errors")}
protected

◆ _measure_interval

uint32_t LidarLite::_measure_interval {LL40LS_CONVERSION_INTERVAL}
private

Definition at line 99 of file LidarLite.h.

◆ _px4_rangefinder

PX4Rangefinder LidarLite::_px4_rangefinder
protected

◆ _sample_perf

perf_counter_t LidarLite::_sample_perf {perf_alloc(PC_ELAPSED, "ll40ls: read")}
protected

Definition at line 93 of file LidarLite.h.

Referenced by LidarLiteI2C::collect(), LidarLitePWM::measure(), print_info(), and ~LidarLite().

◆ _sensor_resets

perf_counter_t LidarLite::_sensor_resets {perf_alloc(PC_COUNT, "ll40ls: resets")}
protected

Definition at line 94 of file LidarLite.h.

Referenced by LidarLiteI2C::collect(), LidarLiteI2C::measure(), print_info(), and ~LidarLite().

◆ _sensor_zero_resets

perf_counter_t LidarLite::_sensor_zero_resets {perf_alloc(PC_COUNT, "ll40ls: zero resets")}
protected

Definition at line 95 of file LidarLite.h.

Referenced by LidarLiteI2C::collect(), LidarLitePWM::measure(), print_info(), and ~LidarLite().


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