# Set waypoints via pymavlink

**URL:** <https://discuss.bluerobotics.com/t/set-waypoints-via-pymavlink/8716>\
**Category:** ArduSub\
**Tags:** ardusub, pymavlink, sitl, simulate\
**Created:** [December 10, 2020, 7:59am UTC](https://discuss.bluerobotics.com/t/set-waypoints-via-pymavlink/8716 "2020-12-10T07:59:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuryArnaut](https://avatars.discourse-cdn.com/v4/letter/y/67e7ee/32.png) [@YuryArnaut](https://discuss.bluerobotics.com/u/YuryArnaut)\
**Post date:** [December 10, 2020, 7:59am UTC](https://discuss.bluerobotics.com/t/set-waypoints-via-pymavlink/8716/1 "2020-12-10T07:59:33Z")

</div>

Hi Bluerobotics! I want to set waypoints to ardusub via pymavlink. I think I should start with one point mission. I saw some messages in pymavlink, list below. Is it some way to do that? I want only use waypoint misiion, I mean point by point mission, passing through in auto mode.

[https://mavlink.io/en/messages/common.html#MAV\_CMD\_NAV\_WAYPOINT](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_WAYPOINT)  
This is not about that, but close.  
[https://mavlink.io/en/messages/common.html#MAV\_CMD\_NAV\_LOITER\_UNLIM](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_LOITER_UNLIM)  
[https://mavlink.io/en/messages/common.html#MAV\_CMD\_NAV\_LOITER\_TURNS](https://mavlink.io/en/messages/common.html#MAV_CMD_NAV_LOITER_TURNS)

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [December 14, 2020, 4:24pm UTC](https://discuss.bluerobotics.com/t/set-waypoints-via-pymavlink/8716/2 "2020-12-14T16:24:24Z")

</div>

Hi @YuryArnaut,

Since missions are not officially supported in ArduSub, that may result in unstable behavior.  
But if you are still willing to test it, you can base your work under pymavlink waypoint code:

> <https://github.com/ArduPilot/pymavlink/blob/master/mavwp.py>

---

<div class="post-metadata">

**Author:** ![em\_1](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@em\_1](https://discuss.bluerobotics.com/u/em_1)\
**Post date:** [June 4, 2021, 10:32pm UTC](https://discuss.bluerobotics.com/t/set-waypoints-via-pymavlink/8716/3 "2021-06-04T22:32:48Z")

</div>

Hello,

I’m trying to do the same thing as @YuryArnaut. I am using this code ([Waypoint\_Test.txt](https://discuss.bluerobotics.com/uploads/short-url/saACAiKQKFs86eNq75gnGTenZem.txt) (1.7 KB)) and testing it through SITL and having trouble getting it to work.  
I get no errors in SITL when I run the code but the ardusub does not move to the waypoints. I’ve tried setting the ardusub into both guided and auto mode and I get the same result.

This is the output from the SITL console:

Got COMMAND\_ACK: COMPONENT\_ARM\_DISARM: ACCEPTED  
Got COMMAND\_ACK: DO\_SET\_MODE: ACCEPTED  
Got MISSION\_ACK: TYPE\_MISSION: ACCEPTED  
APM: Flight plan received  
Got MISSION\_ACK: TYPE\_MISSION: ACCEPTED  
Got COMMAND\_ACK: COMPONENT\_ARM\_DISARM: ACCEPTED

Would you be able to point me to where the problem might be? I’m new to pymavlink so I’m not really sure what the problem is.

Thank you!

---

<div class="post-metadata">

**Author:** ![em\_1](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@em\_1](https://discuss.bluerobotics.com/u/em_1)\
**Post date:** [June 8, 2021, 7:56pm UTC](https://discuss.bluerobotics.com/t/set-waypoints-via-pymavlink/8716/4 "2021-06-08T19:56:23Z")

</div>

I meant to tag @patrickelectric in the above comment but it won’t let me edit.  
If you have any insight on this that would be great!
