Where should I start to write my own UAV control code

Hello, I am going to do research based on UAV. The attached picture is what I want to do with Navio2. Could anyone tell me where should I start? What material should I refer to?


you could start by looking at the ardupilot source code https://github.com/ArduPilot/ardupilot

also have a look at https://github.com/emlid/Navio2

Thank you. I will try that

BTW, from your perspective, do you think it is possible to do that? Has someone else written their own code with ardupilot?

i have always wanted to program my own autopilot and i possibly will. i have done similar work in the area and programmed my own RC transmitter with expo channel reversing and everything you would see in a normal RC transmitter. its definitely possible. you will need to understand PID loops that’s why i told you to look at the source code to figure out how it works. i am still learning how it all works right now and will tell you my findings in the future. the main thing that is teaching me now is kerbal space program and a mod called kos scriptable auto pilot.

Thanks. I will work on that.

Hi ejohn,
Following is my idea to write my own code. Could you help me check whether it’s correct or not?

  1. Write my own subfunction
  2. Call it in the main function.
  3. Upload it in my own directory, for example: https://github.com/jason/ArduPilot/ardupilot.git
  4. Follow the instruction: https://docs.emlid.com/navio2/Navio-APM/building-from-sources/ to Building ArduPilot using Waf build system

is the procedure correct? I also failed to find the main function. Could you tell me the directory of main function?