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

  • Your script should be working fine! Add some Debug.Log() statements in a few areas. Try and output the current waypoint to see if it's actually switching to the next one, and the current waypoints position mcdvoice login

    McDVOICE
  • That worked?? I never tried that command since according to the API it doesn't stop the vehicle.



    Evidlo said:

    I figured this one out too.  Just use MAV_CMD_CONDITION_DELAY to add delay commands after each waypoint.

    # hold position at current location for given seconds
    def delay(time):
        return Command(0, 0, 0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_CONDITION_DELAY, 0, 0, time, 0, 0, 0, 0, 0, 0)


    Melvin said:

    Yea, but i noticed that the "MISSION_ITEM_REACHED" message is thrown after the delay(atleast its like that in the simulation) and i need something to tell me when it has reached it at that exact moment. So im thinking of switchin to Loiter mode after the delay to see if it works just fine). Sadly i live in PR and still got no power to charge up my laptop(bless Irma) and test that.


    Evidlo said:

    Ah, nevermind.  The first argument to MAV_CMD_NAV_WAYPOINT is the hold time.

    Evidlo said:

    Out of curiosity, how are you getting the quadcopter to stop at each waypoint?

    Melvin said:

    Great find Evan, works like a charm.
    • Sadly i live in PR and still got no power to charge up my laptop(bless Irma) and test that.
  • I figured this one out too.  Just use MAV_CMD_CONDITION_DELAY to add delay commands after each waypoint.

    # hold position at current location for given seconds
    def delay(time):
        return Command(0, 0, 0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_CONDITION_DELAY, 0, 0, time, 0, 0, 0, 0, 0, 0)


    Melvin said:

    Yea, but i noticed that the "MISSION_ITEM_REACHED" message is thrown after the delay(atleast its like that in the simulation) and i need something to tell me when it has reached it at that exact moment. So im thinking of switchin to Loiter mode after the delay to see if it works just fine). Sadly i live in PR and still got no power to charge up my laptop(bless Irma) and test that.


    Evidlo said:

    Ah, nevermind.  The first argument to MAV_CMD_NAV_WAYPOINT is the hold time.

    Evidlo said:

    Out of curiosity, how are you getting the quadcopter to stop at each waypoint?

    Melvin said:

    Great find Evan, works like a charm.
  • I think the vehicle should come to a complete stop so long as the delay is nonzero.  Not sure what the minimum is though.

    Melvin said:

    Yea, but i noticed that the "MISSION_ITEM_REACHED" message is thrown after the delay(atleast its like that in the simulation) and i need something to tell me when it has reached it at that exact moment. So im thinking of switchin to Loiter mode after the delay to see if it works just fine). Sadly i live in PR and still got no power to charge up my laptop(bless Irma) and test that.


    Evidlo said:

    Ah, nevermind.  The first argument to MAV_CMD_NAV_WAYPOINT is the hold time.

    Evidlo said:

    Out of curiosity, how are you getting the quadcopter to stop at each waypoint?

    Melvin said:

    Great find Evan, works like a charm.
  • Yea, but i noticed that the "MISSION_ITEM_REACHED" message is thrown after the delay(atleast its like that in the simulation) and i need something to tell me when it has reached it at that exact moment. So im thinking of switchin to Loiter mode after the delay to see if it works just fine). Sadly i live in PR and still got no power to charge up my laptop(bless Irma) and test that.


    Evidlo said:

    Ah, nevermind.  The first argument to MAV_CMD_NAV_WAYPOINT is the hold time.

    Evidlo said:

    Out of curiosity, how are you getting the quadcopter to stop at each waypoint?

    Melvin said:

    Great find Evan, works like a charm.
  • Ah, nevermind.  The first argument to MAV_CMD_NAV_WAYPOINT is the hold time.

    Evidlo said:

    Out of curiosity, how are you getting the quadcopter to stop at each waypoint?

    Melvin said:

    Great find Evan, works like a charm.
  • Out of curiosity, how are you getting the quadcopter to stop at each waypoint?

    Melvin said:

    Great find Evan, works like a charm.
  • Great find Evan, works like a charm.
  • I figured out how to do this with observers the other day.

        @vehicle.on_message('MISSION_ITEM_REACHED')
        def on_waypoint(self, name, message):
            print "Just reached item #{}".format(message.seq

This reply was deleted.

Activity

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…
Saturday
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
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
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
DIY Robocars via Twitter
@gclue_akira CC @NVIDIAEmbedded
Nov 23
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
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
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
DIY Robocars via Twitter
RT @DAVGtech: Live NOW! Alexander Wischnewski of Indy Autonomous Challenge winning TUM team talking racing @diyrobocars @Heavy02011 @Ottawa…
Nov 20
DIY Robocars via Twitter
Incredible training performance with Donkeycar https://www.youtube.com/watch?v=9yy7ASttw04
Nov 9
DIY Robocars via Twitter
RT @JoeSpeeds: Sat Nov 6 Virtual DonkeyCar (and other cars, too) Race. So bring any car? @diyrobocars @IndyAChallenge https://t.co/nZQTff5…
Oct 31
DIY Robocars via Twitter
RT @JoeSpeeds: @chr1sa awesomely scary to see in person as our $1M robot almost clipped the walls as it spun at 140mph. But it was also awe…
Oct 29
DIY Robocars via Twitter
RT @chr1sa: Hey, @a1k0n's amazing "localize by the ceiling lights" @diyrobocars made @hackaday! It's consistently been the fastest in our…
Oct 25
DIY Robocars via Twitter
RT @IMS: It’s only fitting that @BostonDynamics Spot is waving the green flag for today’s @IndyAChallenge! Watch LIVE 👉 https://t.co/NtKnO…
Oct 23
DIY Robocars via Twitter
RT @IndyAChallenge: Congratulations to @TU_Muenchen the winners of the historic @IndyAChallenge and $1M. The first autonomous racecar comp…
Oct 23
DIY Robocars via Twitter
RT @JoeSpeeds: 🏎@TU_Muenchen #ROS 2 @EclipseCyclone #DDS #Zenoh 137mph. Saturday 10am EDT @IndyAChallenge @Twitch http://indyautonomouschallenge.com/stream
Oct 23
More…