2018-10-19 22:51:51 -03:00
|
|
|
#pragma once
|
|
|
|
|
2023-05-03 08:02:35 -03:00
|
|
|
#include "AP_OpticalFlow_config.h"
|
2021-12-24 01:47:21 -04:00
|
|
|
|
|
|
|
#if AP_OPTICALFLOW_HEREFLOW_ENABLED
|
2018-10-19 22:51:51 -03:00
|
|
|
|
2023-05-03 08:02:35 -03:00
|
|
|
#include "AP_OpticalFlow_Backend.h"
|
2023-04-06 21:18:02 -03:00
|
|
|
#include <AP_DroneCAN/AP_DroneCAN.h>
|
2018-10-19 22:51:51 -03:00
|
|
|
|
|
|
|
class AP_OpticalFlow_HereFlow : public OpticalFlow_backend {
|
|
|
|
public:
|
2022-08-14 22:31:14 -03:00
|
|
|
AP_OpticalFlow_HereFlow(AP_OpticalFlow &flow);
|
2018-10-19 22:51:51 -03:00
|
|
|
|
|
|
|
void init() override {}
|
|
|
|
|
|
|
|
void update() override;
|
|
|
|
|
2024-11-16 23:21:13 -04:00
|
|
|
static bool subscribe_msgs(AP_DroneCAN* ap_dronecan);
|
2018-10-19 22:51:51 -03:00
|
|
|
|
2023-04-06 21:18:02 -03:00
|
|
|
static void handle_measurement(AP_DroneCAN *ap_dronecan, const CanardRxTransfer& transfer, const com_hex_equipment_flow_Measurement &msg);
|
2018-10-19 22:51:51 -03:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2023-07-12 08:08:10 -03:00
|
|
|
Vector2f flow_integral, rate_gyro_integral;
|
2018-10-19 22:51:51 -03:00
|
|
|
uint8_t surface_quality;
|
|
|
|
float integral_time;
|
|
|
|
bool new_data;
|
|
|
|
static uint8_t _node_id;
|
|
|
|
|
|
|
|
static AP_OpticalFlow_HereFlow* _driver;
|
2023-04-06 21:18:02 -03:00
|
|
|
static AP_DroneCAN* _ap_dronecan;
|
2018-10-19 22:51:51 -03:00
|
|
|
void _push_state(void);
|
|
|
|
|
|
|
|
};
|
2021-12-24 01:47:21 -04:00
|
|
|
|
|
|
|
#endif // AP_OPTICALFLOW_HEREFLOW_ENABLED
|