PX4 Firmware
PX4 Autopilot Software http://px4.io
LidarLitePWM Class Reference

#include <LidarLitePWM.h>

Inheritance diagram for LidarLitePWM:
Collaboration diagram for LidarLitePWM:

Public Member Functions

 LidarLitePWM (const uint8_t rotation=distance_sensor_s::ROTATION_DOWNWARD_FACING)
 
virtual ~LidarLitePWM ()
 
int init () override
 
void start () override
 
void stop () override
 
void Run () override
 
- Public Member Functions inherited from LidarLite
 LidarLite (const uint8_t rotation=distance_sensor_s::ROTATION_DOWNWARD_FACING)
 
virtual ~LidarLite ()
 
void print_info ()
 Diagnostics - print some basic information about the driver. More...
 
virtual void print_registers ()
 print registers to console. More...
 

Protected Member Functions

int collect () override
 
int measure () override
 
- Protected Member Functions inherited from LidarLite
uint32_t get_measure_interval () const
 
virtual int reset_sensor ()
 

Private Attributes

int _pwmSub {-1}
 
pwm_input_s _pwm {}
 

Additional Inherited Members

- Protected Attributes inherited from LidarLite
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")}
 

Detailed Description

Definition at line 57 of file LidarLitePWM.h.

Constructor & Destructor Documentation

◆ LidarLitePWM()

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

Definition at line 47 of file LidarLitePWM.cpp.

◆ ~LidarLitePWM()

LidarLitePWM::~LidarLitePWM ( )
virtual

Definition at line 53 of file LidarLitePWM.cpp.

References stop().

Here is the call graph for this function:

Member Function Documentation

◆ collect()

int LidarLitePWM::collect ( )
overrideprotectedvirtual

Implements LidarLite.

Definition at line 114 of file LidarLitePWM.cpp.

References _pwm, fd, PWMIN0_DEVICE_PATH, and read().

Referenced by measure().

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

◆ init()

int LidarLitePWM::init ( )
overridevirtual

Implements LidarLite.

Definition at line 59 of file LidarLitePWM.cpp.

References start().

Here is the call graph for this function:

◆ measure()

int LidarLitePWM::measure ( )
overrideprotectedvirtual

Implements LidarLite.

Definition at line 85 of file LidarLitePWM.cpp.

References LidarLite::_comms_errors, _pwm, LidarLite::_px4_rangefinder, LidarLite::_sample_perf, LidarLite::_sensor_zero_resets, collect(), f(), hrt_absolute_time(), hrt_abstime, perf_begin(), perf_count(), perf_end(), pwm_input_s::pulse_width, LidarLite::reset_sensor(), and PX4Rangefinder::update().

Referenced by Run().

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

◆ Run()

void LidarLitePWM::Run ( )
override

Definition at line 79 of file LidarLitePWM.cpp.

References measure().

Here is the call graph for this function:

◆ start()

void LidarLitePWM::start ( )
overridevirtual

Implements LidarLite.

Definition at line 67 of file LidarLitePWM.cpp.

References LidarLite::get_measure_interval().

Referenced by init().

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

◆ stop()

void LidarLitePWM::stop ( )
overridevirtual

Implements LidarLite.

Definition at line 73 of file LidarLitePWM.cpp.

Referenced by ~LidarLitePWM().

Here is the caller graph for this function:

Member Data Documentation

◆ _pwm

pwm_input_s LidarLitePWM::_pwm {}
private

Definition at line 78 of file LidarLitePWM.h.

Referenced by collect(), and measure().

◆ _pwmSub

int LidarLitePWM::_pwmSub {-1}
private

Definition at line 76 of file LidarLitePWM.h.


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