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

  • 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
This reply was deleted.

Activity

DIY Robocars via Twitter
RT @Smartphone89: DonkeyCar Racing League Korea #donkeycar @diyrobocars https://t.co/mDlHDR1d98
7 hours ago
Jørn Ramnæs liked VIDEO LINK's profile
22 hours ago
Mark Harrison left a comment on Moderators
"Wow, Ning2 looks really great on mobile. I had sort of drifted away as my browse-time went more on my phone, so this is great."
yesterday
Hank Deucker left a comment on PIXHAWK
"I am sure most will say not again, Pixhawk telemetry. I do need help and all can be reassured that I have spent many hours scouring the net for useful information. I am not new at quadcopter flying, I started in 2012 and have progressed through many…"
yesterday
DIY Robocars via Twitter
https://t.co/rLmFr8M2UK
yesterday
Hank Deucker left a comment on PIXHAWK
"Tomorrow, I am thinking about the wording at the moment."
yesterday
DIY Drones via Twitter
Welcome to the new DIY Drones design!. You may have noticed that DIY Drones looks a little different today. That's… https://t.co/cg2EmeDGMQ
Wednesday
DIY Drones via Twitter
New! Online Training on Drones for Disaster Response https://t.co/brqRuujjY2
Tuesday
DIY Robocars via Twitter
https://t.co/8EMCvYW6oz
Tuesday
DIY Robocars via Twitter
RT @OttawaAVGroup: We are going to try something new this week. We will be having a drop-in style meeting Wednesday @ 7-9pm EST. Pop in and…
Monday
DIY Robocars via Twitter
RT @tawnkramer: Thanks Everyone for another fun virtual race! Amazing Ai racers competing head-to-head, Virtual Makers Fair event. Catch us…
Sunday
DIY Robocars via Twitter
RT @make: Find out the latest from @diyrobocars at 10am PT from @chr1sa of @3DRobotics on Virtually Make Faire! #makerfaire #maketogether #…
May 23
DIY Robocars via Twitter
RT @Heavy02011: Join us Saturday online: Virtual Race League: @DIYRobocars Race #2 - Parking Lot Nerds https://t.co/aJUu4sdutx #Meetup via…
May 22
DIY Robocars via Twitter
RT @donkey_car: Yay, we are part of the virtual @makerfaire with @diyrobocars. Come see our race or better yet train a model and race with…
May 21
DIY Robocars via Twitter
RT @chr1sa: The @DIYRobocars Virtual AI Race is going to be part of the virtual @makerfaire on Sat! https://t.co/wnMDAboLID
May 20
DIY Robocars via Twitter
RT @tawnkramer: Please join us next week for our second DIYRobocars online race. We will be using a new Mountain Track course! https://t.co…
May 19
More…