4 * control_avoid.cpp - init and run calls for AP_Avoidance's AVOID flight mode
6 * This re-uses GUIDED mode functions but does not interfere with the GCS or companion computer's
7 * use of guided mode because the velocity requests arrive from different sources (i.e MAVLink messages
8 * for GCS and Companion Computers vs the AP_Avoidance_Copter class for adsb avoidance) and inputs from
9 * each source are only accepted and processed in the appropriate flight mode.
12 // initialise avoid_adsb controller
13 bool ModeAvoidADSB::init(const bool ignore_checks
)
16 return ModeGuided::init(ignore_checks
);
19 bool ModeAvoidADSB::set_velocity(const Vector3f
& velocity_neu
)
22 if (copter
.flightmode
->mode_number() != Mode::Number::AVOID_ADSB
) {
26 // re-use guided mode's velocity controller
27 ModeGuided::set_velocity(velocity_neu
);
31 // runs the AVOID_ADSB controller
32 void ModeAvoidADSB::run()
34 // re-use guided mode's velocity controller
35 // Note: this is safe from interference from GCSs and companion computer's whose guided mode
36 // position and velocity requests will be ignored while the vehicle is not in guided mode