The question has been asked before a long time ago but i havn't heard anything of it ever since. Is it possible to find out if a waypoint has been reached? Does dronekit implement this mavlink message? I'm programming a drone to stop for a few seconds once the waypoint is reached and havn't found a way to do so.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • Hi Melvin,

    You can send commands in an Auto mission by using the camera commands:


    Particularly, you should use DO_SET_CAM_TRIGG_DIST or DO_DIGICAM_CONTROL depending on your application. Again, I haven't tested it, but you should be able to send these commands with dronekit according to this guide:


    Hope it helps!


    Camera Control in Auto Missions — Copter documentation
  • Adding an observer/listener didnt work but your first idea did, thank you very much!
    I got one more question, could you point me to somewhere regarding camera control via dronekit if possible? I read something about gimbal control but nothing around camera triggers.


  • Hi Melvin,

    Check this guide and the source code in the bottom of that page. There is some code to execute some actions based on the waypoint the drone is currently heading to. You could store the next_waypoint in a variable and as soon as it changes, it means the waypoint has been reached.

    # Monitor mission.  
    # Demonstrates getting and setting the command number
    # Uses distance_to_current_waypoint(), a convenience function for finding the  
    # distance to the next waypoint.  
    while True:
         print 'Distance to waypoint (%s): %s' % (nextwaypoint, distance_to_current_waypoint())
         if nextwaypoint==3: #Skip to next waypoint
             print 'Skipping to Waypoint 5 when reach waypoint 3'
             vehicle.commands.next = 5
         if nextwaypoint==5: #Dummy waypoint - as soon as we reach waypoint 4 this is true and we exit.
             print "Exit 'standard' mission when start heading to final waypoint (5)"

    Alternatively, you could try to add a listener for this variable (vehicle.commands.next), though I'm not sure it works, you have to test it first.

    Observing parameter changes



  • Hi Javier,

    As it did help quite a lot in part, see im trying to make the drone stop at the waypoint so it can execute a script from its computer companion. In order to do that in code i need something to tell me it reached it so it can execute. Think of it as if(waypoint_reached: Execute script.

    Any ideas if that's possible?
  • You could add a delay of 3 to 5 s in the command:



    Hope it helps!


This reply was deleted.


Mike Whitney liked Mike Whitney's profile
Jul 19
Abdulatif Tlaib liked Ryan's profile
Jun 24