AP_OpticalFlow_HereFlow.h 738 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "OpticalFlow_backend.h"
  3. #if HAL_WITH_UAVCAN
  4. #include <AP_UAVCAN/AP_UAVCAN.h>
  5. class MeasurementCb;
  6. class AP_OpticalFlow_HereFlow : public OpticalFlow_backend {
  7. public:
  8. AP_OpticalFlow_HereFlow(OpticalFlow &flow);
  9. void init() override {}
  10. void update() override;
  11. static void subscribe_msgs(AP_UAVCAN* ap_uavcan);
  12. static void handle_measurement(AP_UAVCAN* ap_uavcan, uint8_t node_id, const MeasurementCb &cb);
  13. private:
  14. Vector2f flowRate, bodyRate;
  15. uint8_t surface_quality;
  16. float integral_time;
  17. bool new_data;
  18. static uint8_t _node_id;
  19. static AP_OpticalFlow_HereFlow* _driver;
  20. static AP_UAVCAN* _ap_uavcan;
  21. void _push_state(void);
  22. };
  23. #endif //HAL_WITH_UAVCAN