I want to implement (or just use if it is already done) a function for Arducopter, or maybe lets call it flight mode "Terrain copy". This means that copter hangs over terrain in altitude reachable by ultrasonic sensor. Lets say around (6m ~ 20ft) over ground. Then it starts to fly in desired direction and some constant speed (less than 3m/s). And the altitude will be automaticly adjusted according to ultrasonic sensor meassuring. This means when the terrain goes up also the copter goes up and vice versa so the relative distance between copter and ground will be constant.
I started to hack Arducopter code just few days ago, but found no sufficient documentation about the general architecture and libraries linking. So it is just about reading and debugging the code. But there is really a lot of lines to read. So I will appreciate any hint pointing me to some exact part of the code that I should focus on.
I also started to draw some dependency/flow diagram to make a global picture how the code(general architecture) is designed. I hope that I will be able to share some relevant version soon for the community. But if there already exists something like UML diagrams just give me the link. My mind likes to read pictures instead of lot of words ;-)
There is also one issue with debugging the code/flight. I was sucessfull to read logs/messages that I implemented for reading the the sensor value. But this is possible only when APM was connected via USB to PC. When I connected it via telemetry link (433MHz), it is possible to connect to the board only via MavLink. I thought that the connection will be transparent for communication with APM. But the terminal window is available only in the cable mode, which is not possible to use in real flight mode. Can you suggest me some approach how to get sensor values, and calculated values for possible flight control other than MavLink integration?
Thanks for any answers to my questions