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
RT @knightsautoteam: Hi @diyrobocars, we are Orlando's first Autonomous racing club and would love your support. We are hosting our first K…
Friday
DIY Robocars via Twitter
RT @Heavy02011: #VirtualRaceLeague: @DIYRobocars Race #14 - #ParkingLotNerds join us January 15th for #AutonomousRacing #RoboRace ⁦@DAVGtec…
Jan 16
DIY Robocars via Twitter
RT @chr1sa: And after that came our races, 50 in all. This battle between these two Russians was the best we've ever seen -- incredible fig…
Jan 16
DIY Robocars via Twitter
RT @chr1sa: Before our @DIYRobocars virtual race this weekend, we had a presentation from the team that won the Indy Autonomous Challenge i…
Jan 16
DIY Drones via Twitter
Dec 12, 2021
DIY Robocars via Twitter
Dec 12, 2021
DIY Robocars via Twitter
RT @chr1sa: Just a week to go before our next @DIYRobocars race at @circuitlaunch, complete with famous Brazilian BBQ. It's free, fun for k…
Dec 4, 2021
DIY Robocars via Twitter
How to use the new @donkey_car graphical UI to edit driving data for better training https://www.youtube.com/watch?v=J5-zHNeNebQ
Nov 28, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Wrote a program to find the light positions at @circuitlaunch. Here is the hypothesis of the light locations updating ba…
Nov 26, 2021
DIY Robocars via Twitter
RT @SmallpixelCar: Broke my @HokuyoUsa Lidar today. Luckily the non-cone localization, based on @a1k0n LightSLAM idea, works. It will help…
Nov 25, 2021
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23, 2021
DIY Robocars via Twitter
RT @luxonis: OAK-D PoE Autonomous Vehicle (Courtesy of zonyl in our Discord: https://discord.gg/EPsZHkg9Nx) https://t.co/PNDewvJdrb
Nov 23, 2021
DIY Robocars via Twitter
RT @f1tenth: It is getting dark and rainy on the F1TENTH racetrack in the @LGSVLSimulator. Testing out the new flood lights for the racetra…
Nov 23, 2021
DIY Robocars via Twitter
RT @JoeSpeeds: Live Now! Alex of @IndyAChallenge winning @TU_Muenchen team talking about their racing strategy and open source @OpenRobotic…
Nov 20, 2021
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20, 2021
DIY Robocars via Twitter
Incredible training performance with Donkeycar https://www.youtube.com/watch?v=9yy7ASttw04
Nov 9, 2021
More…