2014-07-11 23:28:34 -03:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2016-02-17 21:25:42 -04:00
|
|
|
#pragma once
|
2014-07-11 23:28:34 -03:00
|
|
|
|
|
|
|
#include "OpticalFlow.h"
|
|
|
|
|
2015-01-02 04:30:32 -04:00
|
|
|
class AP_OpticalFlow_PX4 : public OpticalFlow_backend
|
2014-07-11 23:28:34 -03:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// constructor
|
2015-01-02 04:30:32 -04:00
|
|
|
AP_OpticalFlow_PX4(OpticalFlow &_frontend);
|
2014-07-11 23:28:34 -03:00
|
|
|
|
|
|
|
// init - initialise the sensor
|
2015-01-02 04:30:32 -04:00
|
|
|
void init();
|
2014-07-11 23:28:34 -03:00
|
|
|
|
|
|
|
// update - read latest values from sensor and fill in x,y and totals.
|
2015-01-02 04:30:32 -04:00
|
|
|
void update(void);
|
2014-07-11 23:28:34 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
int _fd; // file descriptor for sensor
|
|
|
|
uint64_t _last_timestamp; // time of last update (used to avoid processing old reports)
|
|
|
|
};
|