APM:Libraries
AP_OpticalFlow_PX4Flow.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "OpticalFlow.h"
5 
7 {
8 public:
11 
12  // init - initialise the sensor
13  void init() override {}
14 
15  // update - read latest values from sensor and fill in x,y and totals.
16  void update(void) override;
17 
18  // detect if the sensor is available
19  static AP_OpticalFlow_PX4Flow *detect(OpticalFlow &_frontend);
20 
21 private:
23 
24  static const uint8_t REG_INTEGRAL_FRAME = 0x16;
25 
26  // I2C data on register REG_INTEGRAL_FRAME
35  uint32_t sonar_timestamp;
36  uint16_t ground_distance;
38  uint8_t qual;
39  };
40 
41  // scan I2C bus addresses and buses
42  bool scan_buses(void);
43 
44  // setup sensor
45  bool setup_sensor(void);
46 
47  void timer(void);
48 };
static const uint8_t REG_INTEGRAL_FRAME
static AP_OpticalFlow_PX4Flow * detect(OpticalFlow &_frontend)
AP_OpticalFlow_PX4Flow(OpticalFlow &_frontend)
constructor
#define PACKED
Definition: AP_Common.h:28
AP_HAL::OwnPtr< AP_HAL::Device > dev