APM:Libraries
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 
8 {
9 public:
10  // static detection function
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
27 
28  bool measure(void);
29  bool collect(uint16_t &distance_cm);
30 
31  bool init(void);
32  void timer(void);
34 
35  struct {
36  uint32_t sum;
37  uint32_t count;
38  } accum;
39 };
struct AP_RangeFinder_TeraRangerI2C::@177 accum
I2C device type.
Definition: i2c.h:100
uint16_t distance_cm() const
AP_RangeFinder_TeraRangerI2C(RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr< AP_HAL::I2CDevice > i2c_dev)
virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override
AP_HAL::OwnPtr< AP_HAL::I2CDevice > dev
static AP_RangeFinder_Backend * detect(RangeFinder::RangeFinder_State &_state, AP_HAL::OwnPtr< AP_HAL::I2CDevice > i2c_dev)