WAYPOINT REACHED

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 –

Replies

  • Hi Melvin,

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

    http://ardupilot.org/copter/docs/common-camera-control-and-auto-mis...

    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:

    http://python.dronekit.io/guide/auto_mode.html

    Hope it helps!

    Javier

    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.

    Thanks,

    -Melvin
  • 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:
         nextwaypoint=vehicle.commands.next
         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)"
             break;
         time.sleep(1)

    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

    Best,

    Javier

  • 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:

    http://python.dronekit.io/automodule.html#dronekit.Command

    3702386065?profile=original

    Hope it helps!

    Javier

This reply was deleted.

Activity

DIY Robocars via Twitter
Sunday
DIY Robocars via Twitter
Saturday
DIY Robocars via Twitter
May 13
DIY Robocars via Twitter
RT @f1tenth: Say hi to our newest #F1TENTH creation for @ieee_ras_icra next week in Philly. It’s going to be huge! 😎 🔥 @AutowareFdn @PennEn…
May 13
DIY Robocars via Twitter
May 11
DIY Robocars via Twitter
May 8
DIY Robocars via Twitter
RT @SmallpixelCar: Noticed my car zigzagged in last run. It turned out to be the grass stuck in the wheel and made the odometry less accura…
May 8
DIY Robocars via Twitter
RT @SmallpixelCar: Test my car. RTK GPS worked great. Thanks @emlid for their support. https://t.co/EkQ6qmjmWR
May 8
DIY Drones via Twitter
RT @chr1sa: @kane That's @diydrones circa 2009. Still have a box of those Canon cameras that we used to strap into planes, just like this.…
May 3
DIY Robocars via Twitter
RT @chr1sa: Our next @diyrobocars race is going to be outside at a real RC racetrack in Fremont on May 28. Fully autonomous racing, head-to…
Apr 30
DIY Robocars via Twitter
RT @f1tenth: Our Spring 2022 F1TENTH course @PennEngineers is coming to an end with a head-to-head race as a big finale. So proud of our st…
Apr 26
DIY Robocars via Twitter
RT @DanielChiaJH: I wrote a thing! Throughout the development of my @diyrobocars car I've been using @foxglovedev Studio to visualize and d…
Apr 23
DIY Robocars via Twitter
RT @SmallpixelCar: My new car for high speed. Low body, everything ( @NVIDIAEmbedded Jetson Xavier NX, @emlid RTK GPS, IMC) under the deck…
Apr 23
DIY Robocars via Twitter
Apr 21
DIY Robocars via Twitter
RT @f1tenth: F1TENTH Race training setup @PennEngineers for our upcoming ICRA2022 @ieee_ras_icra competition. @OpenRoboticsOrg @IndyAChalle…
Apr 21
DIY Robocars via Twitter
RT @fatcatFABLAB: Proud to be hosting a restarted DIY Robocars NYC Meetup April 26. Come by if you want to talk about and race self-driving…
Apr 17
More…