#pragma once
#include <AP_Avoidance/AP_Avoidance_config.h>
#if AP_ADSB_AVOIDANCE_ENABLED
#include <AP_Avoidance/AP_Avoidance.h>
class AP_Avoidance_Copter : public AP_Avoidance {
public:
using AP_Avoidance::AP_Avoidance;
CLASS_NO_COPY(AP_Avoidance_Copter);
private:
void set_mode_else_try_RTL_else_LAND(Mode::Number mode);
float get_altitude_minimum_m() const;
protected:
MAV_COLLISION_ACTION handle_avoidance(const AP_Avoidance::Obstacle *obstacle, MAV_COLLISION_ACTION requested_action) override;
void handle_recovery(RecoveryAction recovery_action) override;
bool check_flightmode(bool allow_mode_change);
bool handle_avoidance_vertical(const AP_Avoidance::Obstacle *obstacle, bool allow_mode_change);
bool handle_avoidance_horizontal(const AP_Avoidance::Obstacle *obstacle, bool allow_mode_change);
bool handle_avoidance_perpendicular(const AP_Avoidance::Obstacle *obstacle, bool allow_mode_change);
Mode::Number prev_control_mode = Mode::Number::RTL;
};
#endif