APM:Libraries
libraries
AP_RangeFinder
AP_RangeFinder_LightWareI2C.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
RangeFinder.h
"
4
#include "
RangeFinder_Backend.h
"
5
#include <
AP_HAL/I2CDevice.h
>
6
7
class
AP_RangeFinder_LightWareI2C
:
public
AP_RangeFinder_Backend
8
{
9
10
public
:
11
// static detection function
12
static
AP_RangeFinder_Backend
*
detect
(
RangeFinder::RangeFinder_State
&_state,
13
AP_HAL::OwnPtr<AP_HAL::I2CDevice>
dev
);
14
15
// update state
16
void
update
(
void
);
17
18
protected
:
19
20
virtual
MAV_DISTANCE_SENSOR
_get_mav_distance_sensor_type
()
const override
{
21
return
MAV_DISTANCE_SENSOR_LASER;
22
}
23
24
private
:
25
// constructor
26
AP_RangeFinder_LightWareI2C
(
RangeFinder::RangeFinder_State
&_state,
AP_HAL::OwnPtr<AP_HAL::I2CDevice>
dev);
27
28
void
init
();
29
void
timer
();
30
31
// get a reading
32
bool
get_reading
(uint16_t &reading_cm);
33
AP_HAL::OwnPtr<AP_HAL::I2CDevice>
_dev
;
34
};
AP_RangeFinder_LightWareI2C::get_reading
bool get_reading(uint16_t &reading_cm)
Definition:
AP_RangeFinder_LightWareI2C.cpp:71
AP_RangeFinder_LightWareI2C::AP_RangeFinder_LightWareI2C
AP_RangeFinder_LightWareI2C(RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev)
Definition:
AP_RangeFinder_LightWareI2C.cpp:29
I2CDevice.h
AP_RangeFinder_LightWareI2C::timer
void timer()
Definition:
AP_RangeFinder_LightWareI2C.cpp:97
AP_HAL::OwnPtr< AP_HAL::I2CDevice >
dev
static AP_HAL::OwnPtr< AP_HAL::Device > dev
Definition:
ICM20789.cpp:16
AP_RangeFinder_Backend
Definition:
RangeFinder_Backend.h:21
AP_RangeFinder_LightWareI2C::_dev
AP_HAL::OwnPtr< AP_HAL::I2CDevice > _dev
Definition:
AP_RangeFinder_LightWareI2C.h:33
AP_RangeFinder_LightWareI2C
Definition:
AP_RangeFinder_LightWareI2C.h:7
AP_RangeFinder_LightWareI2C::update
void update(void)
Definition:
AP_RangeFinder_LightWareI2C.cpp:92
AP_RangeFinder_LightWareI2C::_get_mav_distance_sensor_type
virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override
Definition:
AP_RangeFinder_LightWareI2C.h:20
AP_RangeFinder_LightWareI2C::detect
static AP_RangeFinder_Backend * detect(RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev)
Definition:
AP_RangeFinder_LightWareI2C.cpp:38
RangeFinder_Backend.h
AP_RangeFinder_LightWareI2C::init
void init()
Definition:
AP_RangeFinder_LightWareI2C.cpp:63
RangeFinder.h
RangeFinder::RangeFinder_State
Definition:
RangeFinder.h:82
Generated on Sun Jun 17 2018 14:18:51 for APM:Libraries by
1.8.13