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.

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.

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.

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.

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:

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?

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?

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?