2016-11-19 02:21:25 -04:00
|
|
|
#pragma once
|
|
|
|
|
2023-05-03 08:02:35 -03:00
|
|
|
#include "AP_OpticalFlow_config.h"
|
2022-08-22 08:20:11 -03:00
|
|
|
|
|
|
|
#if AP_OPTICALFLOW_SITL_ENABLED
|
2016-11-19 02:21:25 -04:00
|
|
|
|
2023-05-03 08:02:35 -03:00
|
|
|
#include "AP_OpticalFlow.h"
|
|
|
|
|
2016-11-19 02:21:25 -04:00
|
|
|
class AP_OpticalFlow_SITL : public OpticalFlow_backend
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// constructor
|
2022-08-22 08:20:11 -03:00
|
|
|
using OpticalFlow_backend::OpticalFlow_backend;
|
2016-11-19 02:21:25 -04:00
|
|
|
|
|
|
|
// update - read latest values from sensor and fill in x,y and totals.
|
2019-02-21 19:11:28 -04:00
|
|
|
void update(void) override;
|
2016-11-19 02:21:25 -04:00
|
|
|
|
|
|
|
private:
|
2022-08-22 08:20:11 -03:00
|
|
|
|
2016-11-19 02:21:25 -04:00
|
|
|
uint32_t last_flow_ms;
|
|
|
|
|
|
|
|
uint8_t next_optflow_index;
|
|
|
|
uint8_t optflow_delay;
|
2022-08-14 22:31:14 -03:00
|
|
|
AP_OpticalFlow::OpticalFlow_state optflow_data[20];
|
2016-11-19 02:21:25 -04:00
|
|
|
};
|
2022-08-22 08:20:11 -03:00
|
|
|
|
|
|
|
#endif // AP_OPTICALFLOW_SITL_ENABLED
|