Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/ArduCopter/avoidance_adsb.h
Views: 1798
#pragma once12#include <AP_Avoidance/AP_Avoidance.h>34// Provide Copter-specific implementation of avoidance. While most of5// the logic for doing the actual avoidance is present in6// AP_Avoidance, this class allows Copter to override base7// functionality - for example, not doing anything while landed.8class AP_Avoidance_Copter : public AP_Avoidance {9public:1011using AP_Avoidance::AP_Avoidance;1213/* Do not allow copies */14CLASS_NO_COPY(AP_Avoidance_Copter);1516private:17// helper function to set modes and always succeed18void set_mode_else_try_RTL_else_LAND(Mode::Number mode);1920// get minimum limit altitude allowed on descend21int32_t get_altitude_minimum() const;2223protected:24// override avoidance handler25MAV_COLLISION_ACTION handle_avoidance(const AP_Avoidance::Obstacle *obstacle, MAV_COLLISION_ACTION requested_action) override;2627// override recovery handler28void handle_recovery(RecoveryAction recovery_action) override;2930// check flight mode is avoid_adsb31bool check_flightmode(bool allow_mode_change);3233// vertical avoidance handler34bool handle_avoidance_vertical(const AP_Avoidance::Obstacle *obstacle, bool allow_mode_change);3536// horizontal avoidance handler37bool handle_avoidance_horizontal(const AP_Avoidance::Obstacle *obstacle, bool allow_mode_change);3839// perpendicular (3 dimensional) avoidance handler40bool handle_avoidance_perpendicular(const AP_Avoidance::Obstacle *obstacle, bool allow_mode_change);4142// control mode before avoidance began43Mode::Number prev_control_mode = Mode::Number::RTL;44};454647