# Using MAVLink and BlueOS for Position Hold on a BlueROV2

By default, the Tracker 650 will send [position delta messages](https://mavlink.io/en/messages/ardupilotmega.html#VISION_POSITION_DELTA) to [mavlink2rest](https://github.com/patrickelectric/mavlink2rest), a component of [BlueOS](https://github.com/bluerobotics/BlueOS-docker).  ArduSub requires these messages to enter Position Hold mode. You can also optionally send MAVLink [DISTANCE\_SENSOR](https://mavlink.io/en/messages/common.html#DISTANCE_SENSOR) [distance messages](https://mavlink.io/en/messages/common.html#DISTANCE_SENSOR) that make the Tracker 650 look like a depth sounder, and optionally a [SET\_GPS\_GLOBAL\_ORIGIN](https://mavlink.io/en/messages/common.html#SET_GPS_GLOBAL_ORIGIN) message.

The position delta messages are necessary but not sufficient for ArduSub to do position hold (see the next two sections for other conditions).

The distance sensor messages tell ArduSub how far off the bottom (or other target surface) the DVL is. ArduSub doesn't really care, but it does pass this information to QGroundControl, which can display this on your piloting screen.

The SET\_GPS\_GLOBAL\_ORIGIN message is described [here](https://docs.ceruleansonar.com/c/tracker-650/using-mavlink-and-blueos-for-position-hold-on-a-bluerov2/global-origin).\
\
The address and port of mavlink2rest are assumed to be 192.168.2.2:6040, which is the default in BlueOS. The address and port will need to be configured if they are different than the default. See [DVL Setup for MAVLink Support](https://docs.ceruleansonar.com/c/tracker-650/using-mavlink-and-blueos-for-position-hold-on-a-bluerov2/tracker-650-setup-for-mavlink-support).\
\
Other ROV operating systems running mavlink2rest may also work, but we have only tested with BlueOS at this time.

{% hint style="info" %}
The Tracker 650 must be on the same Ethernet subnet as the mavlink2rest server
{% endhint %}

{% hint style="info" %}
We recommend using BlueOS version 1.1.0-beta.16 or later. Earlier versions of BlueOS may not have the functionality to support position hold using the MAVLink interface as described here.
{% endhint %}

{% hint style="info" %}
We recommend using ArduSub version 4.1.1 Beta or later. Earlier versions of ArduSub may not have the functionality to support position hold using the MAVLink interface as described here.
{% endhint %}

{% hint style="info" %}
When sending a distance measurement, by default the Tracker 650 will send a parameter in the MAVLink message saying the distance measurement is along the ROV +Z axis (down). If you [tell the ](https://docs.ceruleansonar.com/c/tracker-650/communicating-with-the-tracker-650/commands-accepted-by-the-tracker-650/set-sensor-orientation)Tracker 650[ it is mounted](https://docs.ceruleansonar.com/c/tracker-650/communicating-with-the-tracker-650/commands-accepted-by-the-tracker-650/set-sensor-orientation) pointing other than down (e.g., forward),  the Tracker 650 will say the distance measurement is parallel to the closest one of the ROV principal axis. If the Tracker 650 is pointed in a direction that is ambiguous (e.g., halfway between the +X and +Y axes), the Tracker 650 will use the default (down) parameter.\
\
Possible direction values (automatically derived from your [mounting parameters](https://docs.ceruleansonar.com/c/tracker-650/communicating-with-the-tracker-650/commands-accepted-by-the-tracker-650/set-sensor-orientation)) are:\
\
\- Down (parallel to the +Z axis)\
\- Up (parallel to the -Z axis)\
\- Forward (parallel to the +X axis)\
\- Aft (parallel to the -X axis)\
\- Port (parallel to the -Y axis)\
\- Starboard (parallel to the +Y axis)
{% endhint %}


---

# 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.ceruleansonar.com/c/tracker-650/using-mavlink-and-blueos-for-position-hold-on-a-bluerov2.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.
