# MAVLink

[MAVLink](https://mavlink.io/en/) is a communication protocol supported on a variety of UAV systems. Cyclops uses MAVLink for two-way communication with the flight controller. We require a bi-directional link to the flight controller (to send position estimates and receive sensor measurements).

Below is a list of the messages we use. If your flight controller does *not* support these message types, or only allows for one-way communication over MAVLink, contact the Theseus team for help integrating on your system.

{% hint style="info" %}
By default, Cyclops sends position using the `MAV_CMD_EXTERNAL_POSITION_ESTIMATE` message.  To accept these estimates, ArduPilot needs to not use the GPS in its EKF sources.
{% endhint %}

## Messages Sent

We send a number of packets

* [STATUSTEXT (253)](https://mavlink.io/en/messages/common.html#STATUSTEXT)
* [MAV\_CMD\_USER\_2 (31011)](https://mavlink.io/en/messages/common.html#MAV_CMD_USER_2)
  * crosstrack start command
* [SYSTEM\_TIME (2)](https://mavlink.io/en/messages/common.html#SYSTEM_TIME)
* [TIMESYNC (111)](https://mavlink.io/en/messages/common.html#TIMESYNC)
* [MAV\_CMD\_EXTERNAL\_POSITION\_ESTIMATE (43003)](https://mavlink.io/en/messages/common.html#MAV_CMD_EXTERNAL_POSITION_ESTIMATE)

## Messages Received

* [LOCAL\_POSITION\_NED (32)](https://mavlink.io/en/messages/common.html#LOCAL_POSITION_NED)
* [ATTITUDE\_QUATERNION (31)](https://mavlink.io/en/messages/common.html#ATTITUDE_QUATERNION)
* [GPS\_RAW\_INT (24)](https://mavlink.io/en/messages/common.html#GPS_RAW_INT) (for testing purposes)
* [NAV\_CONTROLLER\_OUTPUT (62)](https://mavlink.io/en/messages/common.html#NAV_CONTROLLER_OUTPUT)
* [VFR\_HUD (74)](https://mavlink.io/en/messages/common.html#VFR_HUD)
* [SYSTEM\_TIME (2)](https://mavlink.io/en/messages/common.html#SYSTEM_TIME)
* [TIMESYNC (111)](https://mavlink.io/en/messages/common.html#TIMESYNC)
* [EXTENDED\_SYS\_STATE (245)](https://mavlink.io/en/messages/common.html#EXTENDED_SYS_STATE)

## System ID (sysid)

If you want to connect to multiple systems over MAVLink, you'll need to use different sysids for each flight controller. The default sysid is 1 so the Micro VPS automatically looks to connect with sysid 1. If the flight controller has a different sysid than the default, the Micro VPS will report no MAV heartbeat.

To configure your Micro VPS to connect with a flight controller with some other sysid, you'll need to edit the vehicle config. Take a look at [Vehicle Configuration](/gcs-software/legacy-software/theseus-gcs-app/feature-list/vehicle-configuration.md#changing-the-sysid) for more information.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.theseus.us/cyclops/autopilot-integration/mavlink.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
