Peter Barker
2 years ago
committed by
Andrew Tridgell
5 changed files with 18 additions and 25 deletions
@ -1,27 +1,25 @@ |
|||||||
#pragma once |
#pragma once |
||||||
|
|
||||||
#include "AP_OpticalFlow.h" |
#include "AP_OpticalFlow.h" |
||||||
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL |
|
||||||
#include <SITL/SITL.h> |
#if AP_OPTICALFLOW_SITL_ENABLED |
||||||
|
|
||||||
class AP_OpticalFlow_SITL : public OpticalFlow_backend |
class AP_OpticalFlow_SITL : public OpticalFlow_backend |
||||||
{ |
{ |
||||||
public: |
public: |
||||||
/// constructor
|
/// constructor
|
||||||
AP_OpticalFlow_SITL(AP_OpticalFlow &_frontend); |
using OpticalFlow_backend::OpticalFlow_backend; |
||||||
|
|
||||||
// init - initialise the sensor
|
|
||||||
void init() override; |
|
||||||
|
|
||||||
// update - read latest values from sensor and fill in x,y and totals.
|
// update - read latest values from sensor and fill in x,y and totals.
|
||||||
void update(void) override; |
void update(void) override; |
||||||
|
|
||||||
private: |
private: |
||||||
SITL::SIM *_sitl; |
|
||||||
uint32_t last_flow_ms; |
uint32_t last_flow_ms; |
||||||
|
|
||||||
uint8_t next_optflow_index; |
uint8_t next_optflow_index; |
||||||
uint8_t optflow_delay; |
uint8_t optflow_delay; |
||||||
AP_OpticalFlow::OpticalFlow_state optflow_data[20]; |
AP_OpticalFlow::OpticalFlow_state optflow_data[20]; |
||||||
}; |
}; |
||||||
#endif // CONFIG_HAL_BOARD
|
|
||||||
|
#endif // AP_OPTICALFLOW_SITL_ENABLED
|
||||||
|
Loading…
Reference in new issue