APM:Libraries
libraries
AP_RangeFinder
AP_RangeFinder_TeraRangerI2C.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_TeraRangerI2C
:
public
AP_RangeFinder_Backend
8
{
9
public
:
10
// static detection function
11
static
AP_RangeFinder_Backend
*
detect
(
RangeFinder::RangeFinder_State
&_state,
12
AP_HAL::OwnPtr<AP_HAL::I2CDevice>
i2c_dev
);
13
14
// update state
15
void
update
(
void
);
16
17
protected
:
18
19
virtual
MAV_DISTANCE_SENSOR
_get_mav_distance_sensor_type
()
const override
{
20
return
MAV_DISTANCE_SENSOR_LASER;
21
}
22
23
private
:
24
// constructor
25
AP_RangeFinder_TeraRangerI2C
(
RangeFinder::RangeFinder_State
&_state,
26
AP_HAL::OwnPtr<AP_HAL::I2CDevice>
i2c_dev);
27
28
bool
measure
(
void
);
29
bool
collect
(uint16_t &
distance_cm
);
30
31
bool
init
(
void
);
32
void
timer
(
void
);
33
AP_HAL::OwnPtr<AP_HAL::I2CDevice>
dev
;
34
35
struct
{
36
uint32_t
sum
;
37
uint32_t
count
;
38
}
accum
;
39
};
AP_RangeFinder_TeraRangerI2C::accum
struct AP_RangeFinder_TeraRangerI2C::@177 accum
AP_RangeFinder_TeraRangerI2C::timer
void timer(void)
Definition:
AP_RangeFinder_TeraRangerI2C.cpp:136
i2c_dev
I2C device type.
Definition:
i2c.h:100
AP_RangeFinder_Backend::distance_cm
uint16_t distance_cm() const
Definition:
RangeFinder_Backend.h:39
AP_RangeFinder_TeraRangerI2C::AP_RangeFinder_TeraRangerI2C
AP_RangeFinder_TeraRangerI2C(RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr< AP_HAL::I2CDevice > i2c_dev)
Definition:
AP_RangeFinder_TeraRangerI2C.cpp:36
I2CDevice.h
AP_HAL::OwnPtr< AP_HAL::I2CDevice >
AP_RangeFinder_Backend
Definition:
RangeFinder_Backend.h:21
AP_RangeFinder_TeraRangerI2C::sum
uint32_t sum
Definition:
AP_RangeFinder_TeraRangerI2C.h:36
AP_RangeFinder_TeraRangerI2C::count
uint32_t count
Definition:
AP_RangeFinder_TeraRangerI2C.h:37
AP_RangeFinder_TeraRangerI2C::_get_mav_distance_sensor_type
virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override
Definition:
AP_RangeFinder_TeraRangerI2C.h:19
AP_RangeFinder_TeraRangerI2C::collect
bool collect(uint16_t &distance_cm)
Definition:
AP_RangeFinder_TeraRangerI2C.cpp:114
AP_RangeFinder_TeraRangerI2C::init
bool init(void)
Definition:
AP_RangeFinder_TeraRangerI2C.cpp:67
AP_RangeFinder_TeraRangerI2C
Definition:
AP_RangeFinder_TeraRangerI2C.h:7
RangeFinder_Backend.h
RangeFinder.h
RangeFinder::RangeFinder_State
Definition:
RangeFinder.h:82
AP_RangeFinder_TeraRangerI2C::dev
AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev
Definition:
AP_RangeFinder_TeraRangerI2C.h:33
AP_RangeFinder_TeraRangerI2C::update
void update(void)
Definition:
AP_RangeFinder_TeraRangerI2C.cpp:154
AP_RangeFinder_TeraRangerI2C::detect
static AP_RangeFinder_Backend * detect(RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr< AP_HAL::I2CDevice > i2c_dev)
Definition:
AP_RangeFinder_TeraRangerI2C.cpp:48
AP_RangeFinder_TeraRangerI2C::measure
bool measure(void)
Definition:
AP_RangeFinder_TeraRangerI2C.cpp:107
Generated on Sun Jun 17 2018 14:18:51 for APM:Libraries by
1.8.13