Line data Source code
1 : #pragma once 2 : 3 : #include "AP_OpticalFlow_config.h" 4 : 5 : #if AP_OPTICALFLOW_HEREFLOW_ENABLED 6 : 7 : #include "AP_OpticalFlow_Backend.h" 8 : #include <AP_DroneCAN/AP_DroneCAN.h> 9 : 10 : class AP_OpticalFlow_HereFlow : public OpticalFlow_backend { 11 : public: 12 : AP_OpticalFlow_HereFlow(AP_OpticalFlow &flow); 13 : 14 0 : void init() override {} 15 : 16 : void update() override; 17 : 18 : static bool subscribe_msgs(AP_DroneCAN* ap_dronecan); 19 : 20 : static void handle_measurement(AP_DroneCAN *ap_dronecan, const CanardRxTransfer& transfer, const com_hex_equipment_flow_Measurement &msg); 21 : 22 : private: 23 : 24 : Vector2f flow_integral, rate_gyro_integral; 25 : uint8_t surface_quality; 26 : float integral_time; 27 : bool new_data; 28 : static uint8_t _node_id; 29 : 30 : static AP_OpticalFlow_HereFlow* _driver; 31 : static AP_DroneCAN* _ap_dronecan; 32 : void _push_state(void); 33 : 34 : }; 35 : 36 : #endif // AP_OPTICALFLOW_HEREFLOW_ENABLED