Hey all,
Problem/Question: I’m trying to understand the algorithm that governs detect and avoid (DAA) for copters and planes, and I’m getting lost.
- Problem 1: which file/files actually run this operation? From what I’ve seen, it’s broken up between:
-The AC_Avoidance and all of it’s sub functions
-AP_ADSB
-AP_Math
Do these functions/scripts/files encompass the entirety of the DAA algorithms?
Also, in both the code and commit comments on github, there’s mention of the rover, copter, and plane all in the same set of codes. Is the ArduPilot code the same for all vehicle types?
Finally, in the AP_ADSB.cpp file, lines 140-146 set an altitude filter. The comment ( “Vehicles detected above this altitude will be completely ignored. They will not show up in the SRx_ADSB stream to the GCS and will not be considered in any avoidance calculations. A value of 0 will disable this filter.”) makes it seem as though this filter is only useful for a rover, because wouldn’t a plane or drone want a lower and upper altitude limit?
*Problem 2: How do these files work together? I’m not looking for an in depth, hand-hold, step by step (I don’t want to waste others time, and I think we learn more when we figure things out by ourselves, I’m just really stuck), but just a general overview/high level look at the sequence of events and/or where in the code (for DAA) each function calls each other function.
-Also, there’s a few articles in the documentation that goes over object avoidance (linked below), is incoming traffic from other drones/planes/moving objects treated the same way as a stationary object? How are the trajectories of traffic calculated?
-https://ardupilot.org/copter/docs/common-simple-object-avoidance.html
-https://ardupilot.org/dev/docs/code-overview-object-avoidance.html
-https://ardupilot.org/copter/docs/common-oa-bendyruler.html
I guess in summary; where is a good place to start diving into the nitty-gritty of the DAA logic? My main focus is understanding how ArduPilot negotiates incoming aerial traffic. I’ve been looking at this for a while, and from the base of the learning curve, it looks like a messy climb.
Background: I’m a college student trying to replicate this code in Python to simulate how this software reacts to traffic. I am fresh-off-the-presses new at Python and all things drones, and I’ve never seen C++ code until now. I’m sorry if this is not the right place to post this question (maybe the discord is better?), or if I’m asking too much, or if this is way too trivial/explained fully in a place I haven’t seen yet. Let me know if I need to be more specific or clarify anything! I’d very much appreciate all the help I can get!
Thank you