Pixhawk Waypoint Mavlink Message

Is it possible to get a list of the current mission’s waypoints from the Pixhawk via MavLink? I need a way to grab the waypoints, do some processing on them on a external device (using C code), and then send an updated list of waypoints to the Pixhawk. I would very much appreciate some advice on how to go about this. Thanks.

Yes there is. http://mavlink.org/messages/common#MISSION_REQUEST_LIST

This is out of date, but gives you an idea of how it works. http://qgroundcontrol.org/mavlink/waypoint_protocol
I’m not aware of a good standalone example implementing mission sync, but here’s how it works on the firmware side.

You might also consider using Dronekit. http://dronekit.io/
It’s a high level wrapper around mavlink.

If ROS is an option for you, I’d recommend doing it with MAVROS. With that it’s as simple as calling a service to get and set a mission.

Thanks guys, I haven’t had a lot of time to check this out yet, but I will look into what was suggested and let everyone now how it goes.

I’ve been able to successfully get waypoints off of the Pixhawk using a series of mission_request_list, then waiting for the count and then sending a mission_request how every many times the count it I received.

However, I’m still having trouble with sending a list of waypoints to the Pixhawk. If I send a mission_count message, the Pixhawk responds with mission_request messages, but it doesn’t seem to get the mission_item messages I send to it after that. It just keeps sending mission_request items with sequence 0 as it never gets the first one.

Does anyone have any ideas I can try with this?

Were you able to do it? Can you post the solution. Thank you.