AP_OpticalFlow_SITL.h 610 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "OpticalFlow.h"
  3. #if CONFIG_HAL_BOARD == HAL_BOARD_SITL
  4. #include <SITL/SITL.h>
  5. class AP_OpticalFlow_SITL : public OpticalFlow_backend
  6. {
  7. public:
  8. /// constructor
  9. AP_OpticalFlow_SITL(OpticalFlow &_frontend);
  10. // init - initialise the sensor
  11. void init() override;
  12. // update - read latest values from sensor and fill in x,y and totals.
  13. void update(void) override;
  14. private:
  15. SITL::SITL *_sitl;
  16. uint32_t last_flow_ms;
  17. uint8_t next_optflow_index;
  18. uint8_t optflow_delay;
  19. OpticalFlow::OpticalFlow_state optflow_data[20];
  20. };
  21. #endif // CONFIG_HAL_BOARD