# Autonomous Code Snippets

**URL:** <https://forum.theavr.org/t/autonomous-code-snippets/610>\
**Category:** AVR Drone Software\
**Created:** [October 3, 2023, 6:29pm UTC](https://forum.theavr.org/t/autonomous-code-snippets/610 "2023-10-03T18:29:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonah](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@Jonah](https://forum.theavr.org/u/Jonah)\
**Post date:** [October 3, 2023, 6:29pm UTC](https://forum.theavr.org/t/autonomous-code-snippets/610/1 "2023-10-03T18:29:38Z")

</div>

My team is working on an autonomous flight path for the AVR drone, but even after scouring the documentation none of us can find a way to control the propellers through the sandbox module. Is there a sample script available anywhere that we can reference? Even something simple like a file that just spins the propellers for a few seconds would do wonders for us.

---

<div class="post-metadata">

**Author:** ![nathan](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.theavr.org/nathan/32/4_2.png) [@nathan](https://forum.theavr.org/u/nathan)\
**Post date:** [October 5, 2023, 12:57am UTC](https://forum.theavr.org/t/autonomous-code-snippets/610/2 "2023-10-05T00:57:58Z")

</div>

Controlling the propellers directly is not really something you’re going to be able to do. PX4 is ultimately talking with the ESCs, and PX4 thinks more in terms of “where I am, and where do I want to go” rather than raw propeller speed.

The closest thing you’ll probably be able to do is quickly arm and disarm the drone on the ground to spin the propellers briefly.

---

<div class="post-metadata">

**Author:** ![Jonah](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@Jonah](https://forum.theavr.org/u/Jonah)\
**Post date:** [October 5, 2023, 1:52am UTC](https://forum.theavr.org/t/autonomous-code-snippets/610/3 "2023-10-05T01:52:30Z")

</div>

That makes sense!

How would I tell the PX4 where to go? Is there a function to set the target location?

---

<div class="post-metadata">

**Author:** ![nathan](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.theavr.org/nathan/32/4_2.png) [@nathan](https://forum.theavr.org/u/nathan)\
**Post date:** [October 5, 2023, 3:00am UTC](https://forum.theavr.org/t/autonomous-code-snippets/610/4 "2023-10-05T03:00:29Z")

</div>

Through QGroundControl or the MQTT endpoints @bhanner-bell made for this year:

> <https://github.com/bellflight/AVR-2022/tree/main/VMC/fcm#go-to-location-ned>
>
> //github.com/bellflight/AVR-2022/tree/main/VMC/fcm

---

<div class="post-metadata">

**Author:** ![Jonah](https://avatars.discourse-cdn.com/v4/letter/j/7feea3/32.png) [@Jonah](https://forum.theavr.org/u/Jonah)\
**Post date:** [October 5, 2023, 12:35pm UTC](https://forum.theavr.org/t/autonomous-code-snippets/610/5 "2023-10-05T12:35:44Z")

</div>

This is amazing! Thank you so much
