Skip to content

Move GLOBAL_POSITION msg from development to common#2403

Closed
bresch wants to merge 2 commits into
mavlink:masterfrom
Auterion:global_pos_dev_to_common
Closed

Move GLOBAL_POSITION msg from development to common#2403
bresch wants to merge 2 commits into
mavlink:masterfrom
Auterion:global_pos_dev_to_common

Conversation

@bresch

@bresch bresch commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

We're happy with the current definition of this message, so unless someone still wants to change something, I think it's time to move it to common.

@sfuhrer

sfuhrer commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

@peterbarker @hamishwillee @auturgy anything against this move?

Comment thread message_definitions/v1.0/common.xml
Comment thread message_definitions/v1.0/common.xml
<field type="uint8_t" name="flags" enum="AIRSPEED_SENSOR_FLAGS">Airspeed sensor flags.</field>
</message>
<message id="296" name="GLOBAL_POSITION">
<description>Global position measurement or estimate.</description>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we expand on this a little? What rate are you outputting it/expecting it to be output. What are you expecting it to be used for? When would you use this instead of one of the GPS_RAW messages?

Basically I want it to be obvious from the description who it is for and when it should be used and how it might be consumed.

@hamishwillee hamishwillee Feb 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaEtUgR ^^^ Who is it for - is it just telemetry for consumption by a GCS? I know you all know what it is, but I don't

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved this discussion to #2419

@hamishwillee hamishwillee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bresch - I know this has been worked on before but I have more questions. Will add to discuss in the MAV call this evening.

@peterbarker

peterbarker commented Jan 28, 2026 via email

Copy link
Copy Markdown
Contributor

@hamishwillee

Copy link
Copy Markdown
Contributor

Is it just me, or is this message currently equivalent to GPS_INPUT, give-or-take?

Given the three messages:

The GLOBAL_POSITION lacks clarity on how it is supposed to be used - I assume it is output from a position system and input to flight stack, so serves the same purpose. However I see GPS_INPUT as very GPS focussed, while this is position-from-any-source focused.

It does raise questions about how much information you really need from a position source for use by an estimator. From the GLOBAL_POSITION message, assuming it does indeed do the job, "nowhere near as much as GPS_INPUT".

That all said, I am still not opposed to additions to allow this to replace https://mavlink.io/en/messages/common.html#GLOBAL_POSITION_INT if we can get that agreed.

Comment thread message_definitions/v1.0/common.xml
@peterbarker

Copy link
Copy Markdown
Contributor

Have talked with Paul, who is currently very interested in this area. He points out that the lense-to-transmission-time is important for any sensible estimator consuming the data. This information is present in the command we are currently using to consume similar information.

To that end, could I propose this as a structure? This does away with the message being at all emitted by the autopilot - this would simply be sensor data.

    <message id="296" name="GLOBAL_POSITION">
      <description>Global position measurement or estimate.</description>
      <field type="uint8_t" name="target_system">System ID (ID of target system, normally flight controller).</field>
      <field type="uint8_t" name="target_component">Component ID (normally 0 for broadcast).</field>
      <field type="uint64_t" name="time_usec" units="us">Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.  This is the time at which this message was transmitted.</field>
      <field type="uint8_t" name="id" instance="true">Sensor ID</field>
      <field type="float" name="processing_time" units="s">The time spent in processing the sensor data that is the basis for this position. The recipient can use this to improve time alignment of the data. This is the time between measurement (e.g. camera exposure time) and transmission of this message. Set to NaN if not known.</field>
      <field type="uint8_t" name="flags" enum="GLOBAL_POSITION_FLAGS">Status flags</field>
      <field type="int32_t" name="lat" units="degE7" invalid="INT32_MAX">Latitude (WGS84)</field>
      <field type="int32_t" name="lon" units="degE7" invalid="INT32_MAX">Longitude (WGS84)</field>
      <field type="float" name="alt" units="m" invalid="NaN">Altitude (MSL - position-system specific value)</field>  <!-- is AMSL the right frame?  Do we want a FRAME? -->
      <field type="float" name="eph" units="m" invalid="NaN">Standard deviation of horizontal position error</field>
      <field type="float" name="epv" units="m" invalid="NaN">Standard deviation of vertical position error</field>
    </message>

I've removed several fields and added a couple. Addition of velocity to be argued over - Paul doesn't have a use for it ATM - we could add it as NaN-default or we could leave it as an extension.

@peterbarker

Copy link
Copy Markdown
Contributor

Random thought. ArduPilot's EKF can impose constraints on control for the vehicle depending on its input - so if you're using optical flow then your height and velocity are limited.

That may be applicable for some of these external sources that may come in via (e.g. GLOBAL_POSITION) , but that hasn't come up in any conversation I've seen. Easy enough to say "outside the scope", but....

@hamishwillee

Copy link
Copy Markdown
Contributor

@peterbarker Looking at your changes

  • you've dropped the source, which is probably relevant.
  • Having this like a sensor with status info seems great to me.
  • What flags were you considering for the status?
  • Dropping the elipsoid field could be a problem. Unlike AMSL it is a reliable reference that is independent of a particular vendor calcuulation.
  • I assume the timestamp is time of MAVLink emission. It does seem relevant that the delay from generation to emission be included if it can be.
  • I thought you wanted velocity so this might be a replacement for GLOBAL_POSITION_INT?

For all of this, I think we need Paul @bresch (and possibly @sfuhrer ) in a discussion. It isn't up to me.

Random thought. ArduPilot's EKF can impose constraints on control for the vehicle depending on its input - so if you're using optical flow then your height and velocity are limited.

That may be applicable for some of these external sources that may come in via (e.g. GLOBAL_POSITION) , but that hasn't come up in any conversation I've seen. Easy enough to say "outside the scope", but....

I was thinking that was what GLOBAL_POSITION was for. Its a reasonable question "do we have enough information to do the job from this".

@peterbarker

Copy link
Copy Markdown
Contributor
* you've dropped the source, which is probably relevant.

Perhaps; as an input to the autopilot it is probably less relevant than as a report from the autopilot.

* What flags were you considering for the status?

I didn't have any in mind, but thought it prudent to include something.

* Dropping the elipsoid field could be a problem. Unlike AMSL it is a reliable reference that is independent of a particular vendor calcuulation.

I can add that back in. Should we allow only a single altitude and a frame for it?

* I assume the timestamp is time of MAVLink emission. It does seem relevant that the delay from generation to emission be included if it can be.

Yes, the timestamp is when the packet left the vehicle, near enough.

* I thought you wanted velocity so this might be a replacement for GLOBAL_POSITION_INT?

This is no longer a replacement for GLOBAL_POSITION_INT. We'll need a separate message for that.

Comment thread message_definitions/v1.0/common.xml Outdated
<message id="296" name="GLOBAL_POSITION">
<description>Global position measurement or estimate.</description>
<field type="uint8_t" name="id" instance="true">Sensor ID</field>
<field type="uint64_t" name="time_usec" units="us">Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.</field>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From Paul: add sensor delay

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bresch We can do that - what about the other comments?

@priseborough

Copy link
Copy Markdown

For my application the inclusion of a sensor delay field is essential.
Sending it as delay rather than a second time stamp is preferable for debugging because the MAVLink data stream can be monitored in real time and the sensor delay read directly rather than requiring the developer to mentally subract two large rapidly changing numbers form each other.
With respect to the height field, I don't use it in my application, however IMO it would be advisable to allow users to use ellipsoid height if they wish as there are sensing modalities, eg star trackers, that are doing the calculations in ECI with a transformation to ECEF.

@hamishwillee

Copy link
Copy Markdown
Contributor

For my application the inclusion of a sensor delay field is essential. Sending it as delay rather than a second time stamp is preferable for debugging because the MAVLink data stream can be monitored in real time and the sensor delay read directly rather than requiring the developer to mentally subract two large rapidly changing numbers form each other. With respect to the height field, I don't use it in my application, however IMO it would be advisable to allow users to use ellipsoid height if they wish as there are sensing modalities, eg star trackers, that are doing the calculations in ECI with a transformation to ECEF.

@priseborough I think that makes sense, but can you please add the change as a github suggestion to this PR exactly how you want it? That way I don't bugger it up.

- target system/component I assume to allow routing
- more clear timestamp description
- add processing time for simple to support and debug compensation without separate time synchronization
- for most clear definition unify to only elipsoidal altitude
@priseborough

Copy link
Copy Markdown

For my application the inclusion of a sensor delay field is essential. Sending it as delay rather than a second time stamp is preferable for debugging because the MAVLink data stream can be monitored in real time and the sensor delay read directly rather than requiring the developer to mentally subract two large rapidly changing numbers form each other. With respect to the height field, I don't use it in my application, however IMO it would be advisable to allow users to use ellipsoid height if they wish as there are sensing modalities, eg star trackers, that are doing the calculations in ECI with a transformation to ECEF.

@priseborough I think that makes sense, but can you please add the change as a github suggestion to this PR exactly how you want it? That way I don't bugger it up.

Hamish, I've coordinated with the authors and they've included the message I requested in their latest commit.

@MaEtUgR

MaEtUgR commented Feb 12, 2026

Copy link
Copy Markdown
Contributor

I just took over all the feedback into a commit while on a call with @priseborough and @haumarco to have a new version to review.

  • target system/component I assume to allow routing (@peterbarker 's suggestion)
  • more clear timestamp description (@priseborough 's suggestion)
  • add processing time for simple to support and debug compensation without separate time synchronization (@priseborough 's suggestion)
  • for most clear definition unify to only elipsoidal altitude (as far as I understand @priseborough , @bresch agree this is the most coherent way, does it have real-world limitations?)

Comment on lines +1080 to +1109
<entry value="0" name="GLOBAL_POSITION_UNKNOWN">
<description>Source is unknown or not one of the listed types.</description>
</entry>
<entry value="1" name="GLOBAL_POSITION_GNSS">
<description>Global Navigation Satellite System (e.g.: GPS, Galileo, Glonass, BeiDou).</description>
</entry>
<entry value="2" name="GLOBAL_POSITION_VISION">
<description>Vision system (e.g.: map matching).</description>
</entry>
<entry value="3" name="GLOBAL_POSITION_PSEUDOLITES">
<description>Pseudo-satellite system (performs GNSS-like function, but usually with transceiver beacons).</description>
</entry>
<entry value="4" name="GLOBAL_POSITION_TRN">
<description>Terrain referenced navigation.</description>
</entry>
<entry value="5" name="GLOBAL_POSITION_MAGNETIC">
<description>Magnetic positioning.</description>
</entry>
<entry value="6" name="GLOBAL_POSITION_ESTIMATOR">
<description>Estimated position based on various sensors (eg. a Kalman Filter).</description>
</entry>
</enum>
<enum name="GLOBAL_POSITION_FLAGS" bitmask="true">
<description>Status flags for GLOBAL_POSITION</description>
<entry value="1" name="GLOBAL_POSITION_UNHEALTHY">
<description>Unhealthy sensor/estimator.</description>
</entry>
<entry value="2" name="GLOBAL_POSITION_PRIMARY">
<description>True if the data originates from or is consumed by the primary estimator.</description>
</entry>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the enums should be named with prefix GLOBAL_POSITION_SRC_ by convention.

Suggested change
<entry value="0" name="GLOBAL_POSITION_UNKNOWN">
<description>Source is unknown or not one of the listed types.</description>
</entry>
<entry value="1" name="GLOBAL_POSITION_GNSS">
<description>Global Navigation Satellite System (e.g.: GPS, Galileo, Glonass, BeiDou).</description>
</entry>
<entry value="2" name="GLOBAL_POSITION_VISION">
<description>Vision system (e.g.: map matching).</description>
</entry>
<entry value="3" name="GLOBAL_POSITION_PSEUDOLITES">
<description>Pseudo-satellite system (performs GNSS-like function, but usually with transceiver beacons).</description>
</entry>
<entry value="4" name="GLOBAL_POSITION_TRN">
<description>Terrain referenced navigation.</description>
</entry>
<entry value="5" name="GLOBAL_POSITION_MAGNETIC">
<description>Magnetic positioning.</description>
</entry>
<entry value="6" name="GLOBAL_POSITION_ESTIMATOR">
<description>Estimated position based on various sensors (eg. a Kalman Filter).</description>
</entry>
</enum>
<enum name="GLOBAL_POSITION_FLAGS" bitmask="true">
<description>Status flags for GLOBAL_POSITION</description>
<entry value="1" name="GLOBAL_POSITION_UNHEALTHY">
<description>Unhealthy sensor/estimator.</description>
</entry>
<entry value="2" name="GLOBAL_POSITION_PRIMARY">
<description>True if the data originates from or is consumed by the primary estimator.</description>
</entry>
<entry value="0" name="GLOBAL_POSITION_SRC_UNKNOWN">
<description>Source is unknown or not one of the listed types.</description>
</entry>
<entry value="1" name="GLOBAL_POSITION_SRC_GNSS">
<description>Global Navigation Satellite System (e.g.: GPS, Galileo, Glonass, BeiDou).</description>
</entry>
<entry value="2" name="GLOBAL_POSITION_SRC_VISION">
<description>Vision system (e.g.: map matching).</description>
</entry>
<entry value="3" name="GLOBAL_POSITION_SRC_PSEUDOLITES">
<description>Pseudo-satellite system (performs GNSS-like function, but usually with transceiver beacons).</description>
</entry>
<entry value="4" name="GLOBAL_POSITION_SRC_TRN">
<description>Terrain referenced navigation.</description>
</entry>
<entry value="5" name="GLOBAL_POSITION_SRC_MAGNETIC">
<description>Magnetic positioning.</description>
</entry>
<entry value="6" name="GLOBAL_POSITION_SRC_ESTIMATOR">
<description>Estimated position based on various sensors (eg. a Kalman Filter).</description>
</entry>
</enum>
<enum name="GLOBAL_POSITION_SRC_FLAGS" bitmask="true">
<description>Status flags for GLOBAL_POSITION</description>
<entry value="1" name="GLOBAL_POSITION_UNHEALTHY">
<description>Unhealthy sensor/estimator.</description>
</entry>
<entry value="2" name="GLOBAL_POSITION_SRC_PRIMARY">
<description>True if the data originates from or is consumed by the primary estimator.</description>
</entry>

@hamishwillee

hamishwillee commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@MaEtUgR Thanks very much. @peterbarker @bresch @priseborough Otherwise are we all happy with this?

I have moved this back into development because it will need to be retested before being accepted #2419

@peterbarker peterbarker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks fine as a message. Lacking velocity data still - I wonder if that will come back to haunt us.

@priseborough and I will have a look at putting this into ArduPilot.

Not sure moving it from development.xml to common.xml is kosher, even according to the rules at https://docs.px4.io/main/en/mavlink/adding_messages , is it? I don't see an implementation in PX-AutoPilot

@hamishwillee

hamishwillee commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Moving it from development.xml to common.xml is kosher, even according to the rules at https://docs.px4.io/main/en/mavlink/adding_messages , is it? I don't see an implementation in PX-AutoPilot

True. We need verification of implementation. Let's get #2419 in first, tested, and then we can do this move again.

@hamishwillee

Copy link
Copy Markdown
Contributor

Closing. Superseded by #2422

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants