CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/ArduPlane/avoidance_adsb.h
Views: 1798
1
#pragma once
2
3
#include <AP_Avoidance/AP_Avoidance.h>
4
5
// Provide Plane-specific implementation of avoidance. While most of
6
// the logic for doing the actual avoidance is present in
7
// AP_Avoidance, this class allows Plane to override base
8
// functionality - for example, not doing anything while landed.
9
class AP_Avoidance_Plane : public AP_Avoidance {
10
public:
11
12
using AP_Avoidance::AP_Avoidance;
13
14
/* Do not allow copies */
15
CLASS_NO_COPY(AP_Avoidance_Plane);
16
17
protected:
18
// override avoidance handler
19
MAV_COLLISION_ACTION handle_avoidance(const AP_Avoidance::Obstacle *obstacle, MAV_COLLISION_ACTION requested_action) override;
20
21
// override recovery handler
22
void handle_recovery(RecoveryAction recovery_action) override;
23
24
// check flight mode is avoid_adsb
25
bool check_flightmode(bool allow_mode_change);
26
27
// vertical avoidance handler
28
bool handle_avoidance_vertical(const AP_Avoidance::Obstacle *obstacle, bool allow_mode_change, Location &new_loc);
29
30
// horizontal avoidance handler
31
bool handle_avoidance_horizontal(const AP_Avoidance::Obstacle *obstacle, bool allow_mode_change, Location &new_loc);
32
33
// control mode before avoidance began
34
enum Mode::Number prev_control_mode_number = Mode::Number::RTL;
35
};
36
37