2020-12-31 20:10:39 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AP_RangeFinder_Backend.h"
|
|
|
|
#include <AP_CANManager/AP_CANSensor.h>
|
|
|
|
|
|
|
|
#if HAL_MAX_CAN_PROTOCOL_DRIVERS
|
|
|
|
|
|
|
|
class AP_RangeFinder_USD1_CAN : public CANSensor, public AP_RangeFinder_Backend {
|
|
|
|
public:
|
|
|
|
AP_RangeFinder_USD1_CAN(RangeFinder::RangeFinder_State &_state, AP_RangeFinder_Params &_params);
|
|
|
|
|
|
|
|
void update() override;
|
|
|
|
|
|
|
|
// handler for incoming frames
|
|
|
|
void handle_frame(AP_HAL::CANFrame &frame) override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual MAV_DISTANCE_SENSOR _get_mav_distance_sensor_type() const override {
|
|
|
|
return MAV_DISTANCE_SENSOR_RADAR;
|
|
|
|
}
|
|
|
|
private:
|
2021-10-18 00:20:53 -03:00
|
|
|
float _distance_sum;
|
|
|
|
uint32_t _distance_count;
|
2020-12-31 20:10:39 -04:00
|
|
|
};
|
|
|
|
#endif //HAL_MAX_CAN_PROTOCOL_DRIVERS
|
|
|
|
|