How to run my own code without any trouble?

Recently, I started working on project that aims to make the quadcopter land autonomously… The thing is I should write my own code and logic using the built in libraries, right?.. I want to read the sensors and camera readings, then, run and control the quadcopter based on these readings. I know how to control it theoretically, but I need to learn the Ardupilot Programming… Where should I start to learn how to write my own code and upload it to the controller? thank you so much in advance!!

What I need is to know how to code in the controller… that’s it… I know the necessary concepts and theories for the autonomous landing!! Waiting for your responses!

This is the best place to start - Welcome to the ArduPilot Development Site — Dev documentation

Actually, I could find the source code for the Copter I’m working on, which is written in C++… However, I want to write my code in python because I need to use some machine vision algorithms. So, my question is “How can I write my code in Python although the source code of the copter is written in C++?”… Can DroneKit do the job for me? I found it in this website … thanks for your response!!