The application responsible for multicopter position control exists in “Firmware/src/modules/mc_pos_control”. I will describe what I understand about this application as much as I can in this blog.
The application is started by the script “rc.mc_apps” in “Firmware/ROMFS/px4fmu_common/init.d”. The script itself is called by the main starting script “rcS” at line 761. Since “rc.mc_apps” is a very short script, I will paste it here for convenience: