I’m starting new development using ArduPilot which basically would allow the drone to fly really close from the ground (~1-2 meters) using a downward facing Lidar or Sonar. The idea is to filter the data provided by the Lidar (and others input data) to define the minimum altitude of flight during mission. The idea of machine learning could be use to provide better results (apply for vineyard in my case).
In order to start the development, I have few questions about the code:
If I want to set the altitude that the drone should have, where this altitude needs to be define ? I try to find where the final decision is set but I can’t figure it out. In AC_WPNav.h, the function set_rangefinder_alt update the altitude of the range finder, but AC_PosControl.cpp only use _inva.get_altitude() in pos_to_rate_z() function.
To add new functions which take multiple data to provide a final altitude, should I write a library in the same way than Object avoidance ? I don’t get all the interaction between classes and it’s hard to understand the best way to add my code in the project…
Some explanations on this interaction and the way the altitude is taken into account will be greatly appreciated !