Basically my goal is to add a new mode which allow the pilot to perform an autotakeoff just by switching a button on the radiocontroller.
e.g. the radio controller is on off then the pilot switches to autotakeoff mode, then the drone arms the motors and take off to a default altitude and then when it reaches this altitude, the drone goes back to POSHOLD and wait for the next command.
But i am lost on the step i should do to success this.
i read the page “how to add a new flight mode” but i am still not sure what the init() method should do and what the run() should do.
I guess i also have to override the allows_arming() method to let me arm the motors in the new mode.
Does someone have already do something similar?
thank you in advance,