I am trying to develop a way stop a mission in ArduCopter.
For now, I saw that there is already a method in
AP_Mission::stop(), that just changes the state flag of the mission and prevents it from being updated via
Well, I managed to make Mission Planner to send a MAVLink message that, when received, calls this AP_Mission::stop() method. After I call the method, I can see that the flag turns to MISSION_STOPPED right away, but the drone only stops when it reaches the waypoint that it is going to (assuming that there is a NAV command running). I am doing these tests with SITL for now.
I wanted to know if this behavior is correct and if someone could help me understand more about how does the relationship between the mission commands and the drone movement works. Thanks