Skip to content

docs: clarify SET_MESSAGE_INTERVAL stream rate config per serial port - #694

Open
ARYA-mgc wants to merge 8 commits into
mavlink:masterfrom
ARYA-mgc:docs/set-message-interval-stream-rate-clarification
Open

docs: clarify SET_MESSAGE_INTERVAL stream rate config per serial port#694
ARYA-mgc wants to merge 8 commits into
mavlink:masterfrom
ARYA-mgc:docs/set-message-interval-stream-rate-clarification

Conversation

@ARYA-mgc

@ARYA-mgc ARYA-mgc commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves the MAV_CMD_SET_MESSAGE_INTERVAL stream rate configuration details
to a new dedicated guide (en/guide/stream_rates.md) to keep the auto-generated
common.md clean.

The new guide covers:

  • Targeting specific telemetry streams
  • Silencing unused streams using interval=-1 (and confirms this behavior across PX4 and ArduPilot)
  • Clarifies that outbound streams from companion computers (VISION_POSITION_ESTIMATE) are independent of stream rates.
  • Removes ArduPilot-specific language (SR2_*) and replaces it with stack-neutral language.

Motivation

Provide developers with actionable instructions on managing stream rates without cluttering
the auto-generated XML/Markdown messages definitions, per reviewer feedback.

Comment thread en/messages/common.md Outdated
@ARYA-mgc
ARYA-mgc force-pushed the docs/set-message-interval-stream-rate-clarification branch from 08d8a3c to f24a0b1 Compare April 14, 2026 05:34
@ARYA-mgc

Copy link
Copy Markdown
Contributor Author

I've moved the content from the auto-generated common.md into a dedicated en/guide/stream_rates.md page. I also confirmed the -1 behavior applies to both PX4 and ArduPilot, replaced the ArduPilot-specific SR2_* terminology with stack-neutral language, and clarified the distinction for outbound streams like VISION_POSITION_ESTIMATE.

@ARYA-mgc ARYA-mgc changed the title docs: clarify SET_MESSAGE_INTERVAL stream rate config per serial port (#173) docs: clarify SET_MESSAGE_INTERVAL stream rate config per serial port Apr 14, 2026
@ARYA-mgc
ARYA-mgc force-pushed the docs/set-message-interval-stream-rate-clarification branch from f24a0b1 to 16d27ef Compare April 14, 2026 06:04
@ARYA-mgc

Copy link
Copy Markdown
Contributor Author

Hey @hamishwillee, I have addressed your feedback!
I cleaned the branch and moved the tutorial-style content from the auto-generated \common.md\ to a new dedicated guide \en/guide/stream_rates.md.

Specific fixes included:

  • Adopted stack-neutral phrasing instead of purely ArduPilot \SR2_*\ references.
  • Clarified the difference between outbound streams (like \VISION_POSITION_ESTIMATE) and requested streams.
  • Verified in the ArduPilot and PX4 source that an interval of -1\ indeed disables the stream, and updated the wording string as suggested.

The PR in \mavlink/mavlink\ (#2463) has also been rebased and updated to cross-link to this new guide. Ready for another look!

Comment thread en/guide/stream_rates.md Outdated
Comment thread en/guide/stream_rates.md Outdated
| `SCALED_IMU2` (id: 116) | -1 | Disabled |
| `HIGHRES_IMU` (id: 105) | -1 | Disabled |

## Outbound Streams (Sent by Companion Computer)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • Outbound stream is not the best terminology here - VISION_POSITION_ESTIMATE is outbound from a computer but it is inbound to the FC. Similarly GPS_RAW is oubound from the FC but inbound to a GCS. Most of MAVLink is FC centric - so inbound would be more accurate - but it is still wrong.
  • The fact is that the rate of VISION_POSITION_ESTIMATE should theoretically be tunable via the rate setting message from a GCS or whatever manages the link. Generally we don't though because the links are tuned to have an acceptable rate.

The main differentiation here is Telemetry messages vs command like messages - so perhaps "Command-like Messages"

@hamishwillee hamishwillee Apr 15, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Generally I am not comfortable with the examples and comments like "you should silence all other stream rates to keep the serial line clean." Because it depends so much on your setup. Happy with general comments at this level about "you can use this for QoS, reducing or increasing the rate of telemetry streams as needed"

@hamishwillee hamishwillee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@ARYA-mgc Thanks for this. I've added some point suggestions.

I'm not entirely sure about this - on one hand QoS is a high level guide-like topic, on the other hande we have a bunch of approaches for setting streaming, so we might be better off having that stuff in a Message Streaming Protocol doc.

This would cover

  • MAV_CMD_SET_MESSAGE_INTERVAL, but also MESSAGE_INTERVAL, MAV_CMD_REQUEST_MESSAGE (deprecated MAV_CMD_GET_MESSAGE_INTERVAL), DATA_STREAM.
  • It would follow the same pattern as other protocol docs. It would have an implementation section covering similarities and differences in the implementations, which is where you could cover the parameters.

I think I prefer that approach.

@ARYA-mgc

Copy link
Copy Markdown
Contributor Author

PR Update - Cleaned Up

Hi @hamishwillee,

I've made the following updates to this PR:

  1. Content moved to the correct file: Documentation was placed in en/guide/stream_rates.md (a new dedicated guide page), NOT in en/messages/common.md (which is auto-generated). The file also registers in en/SUMMARY.md.
  2. Unrelated commits removed: The branch has been rebased and now contains only a single relevant commit: docs: clarify MAV_CMD_SET_MESSAGE_INTERVAL stream rate config.
  3. Test results for interval=-1:
    • PX4 (v1.11+): Setting param2 = -1 in MAV_CMD_SET_MESSAGE_INTERVAL silences the specified stream - confirmed the message stops being sent on that serial port.
    • ArduPilot (v4.0+): Same behavior - interval=-1 successfully disables the stream. This is equivalent to setting the corresponding SR*_* parameter to 0.
    • Setting interval=0 restores the default rate on both platforms.
      Thank you for your patience and detailed feedback!

@ARYA-mgc
ARYA-mgc requested a review from hamishwillee April 22, 2026 06:17
@ARYA-mgc

Copy link
Copy Markdown
Contributor Author

Hi @hamishwillee, I've addressed the earlier feedback. For the remaining suggestion — would you prefer I expand this into a full Message Streaming Protocol doc covering MAV_CMD_SET_MESSAGE_INTERVAL, MESSAGE_INTERVAL, MAV_CMD_REQUEST_MESSAGE, and DATA_STREAM? Or are the terminology fixes in the current stream_rates.md sufficient to merge?

@ARYA-mgc
ARYA-mgc force-pushed the docs/set-message-interval-stream-rate-clarification branch from 16d27ef to 3a286d1 Compare April 22, 2026 06:35
@hamishwillee

Copy link
Copy Markdown
Collaborator

@ARYA-mgc Sorry, I am going to delay this until I have bandwidth.

@ARYA-mgc

ARYA-mgc commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

No worries, take your time! I'll keep the branch rebased in the meantime. Let me know if there's anything I can improve before your review.

@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.

"stream_rates.md" is a little misleading.

ArduPilot still supports the actual MAV_DATA_STREAM scheme. That's where a bunch of different messages are thrown into buckets which. It predates the SET_MESSAGE_INTERVAL stuff by a very long time.

Might I suggest "message_rates.md" instead?

Comment thread en/guide/stream_rates.md Outdated

## Configuring Stream Rates on a Specific Port

To avoid buffer overruns on high-baud serial links (e.g. 921600 baud TELEM2), you should explicitly configure only the streams required for your use case using `MAV_CMD_SET_MESSAGE_INTERVAL`.

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.

This is a very strange way to put things.

Often people are reducing the rates rather than increasing them with the message.

And the buffer overruns are more likely to happen at low baudrates rather than high?!

Your statement is also ambiguous - in a few ways! It could mean "don't turn on anything you don't need" or "you should only modify the things you care about".

Comment thread en/guide/stream_rates.md Outdated
Comment thread en/guide/stream_rates.md Outdated

## Command-like Messages

Messages that are injected into the flight controller from a companion computer (such as `VISION_POSITION_ESTIMATE`) are conceptually different from the vehicle telemetry streams configured via `MAV_CMD_SET_MESSAGE_INTERVAL`.

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.

No, they're really not.

There's no reason a flight controller couldn't request whoever is sending VISION_POSITION_ESTIMATE to send at a particular rate. I've never seen it, but conceptually it's just the same as a GCS asking for RAW_IMU.

In fact, it would make a lot of sense for a mavlink-connected camera/gimbal combination to ask the autopilot to stream the vehicle's current location to it for metadata tagging. Several other gimbals already request this through their own protocols.

Comment thread en/guide/stream_rates.md Outdated
| `SCALED_IMU2` (id: 116) | -1 | Disabled |
| `HIGHRES_IMU` (id: 105) | -1 | Disabled |

## Command-like Messages

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.

AutoPilot Input Messages if you want to keep this section?

Comment thread en/guide/stream_rates.md Outdated
@ARYA-mgc
ARYA-mgc force-pushed the docs/set-message-interval-stream-rate-clarification branch 3 times, most recently from 534e7f0 to 6683bbd Compare September 2, 2026 18:51
- Adds dedicated guide: en/guide/message_rates.md
- Adopts stack-neutral QoS language
- Adds per-link scoping clarification
- Renames section to AutoPilot Input Messages
- Uses MAVn_* parameters instead of SR2_*
- Adds HIGHRES and TELEM to cspell wordlist
@ARYA-mgc
ARYA-mgc force-pushed the docs/set-message-interval-stream-rate-clarification branch from 6683bbd to 4a48bc5 Compare September 2, 2026 18:54
@ARYA-mgc

ARYA-mgc commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Hi @peterbarker , @hamishwillee I've addressed all the feedback:

Renamed stream_rates.md ->message_rates.md
Cleaned up the baud rate / buffer overrun wording to focus neutrally on QoS and per-link scoping
Renamed the section to AutoPilot Input Messages and adjusted the wording
Rebased onto latest master - CI is green with zero conflicts

Ready for another look!

Comment thread en/guide/message_rates.md Outdated
Comment thread en/guide/message_rates.md Outdated
Comment thread en/guide/message_rates.md Outdated
Comment thread en/guide/message_rates.md Outdated
ARYA-mgc and others added 3 commits September 3, 2026 07:02
Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>
Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>
Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>
Comment thread en/guide/message_rates.md
@@ -0,0 +1,31 @@
# Message Rates

This section provides guidance on configuring MAVLink message rates using the `MAV_CMD_SET_MESSAGE_INTERVAL` command.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In guide generally link first instance of a message to its definition (in the docs, not in the xml)

Comment thread en/guide/message_rates.md Outdated
Comment thread en/guide/message_rates.md
Comment on lines +13 to +14
Supported on PX4 v1.11+ and ArduPilot v4.0+.
Behavior on older versions of these two autopilots is undefined.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Did you check earlier versions, or is this just the version you checked?

What do you mean by undefined? Not supported?

Comment thread en/guide/message_rates.md
Comment thread en/guide/message_rates.md Outdated

@hamishwillee hamishwillee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've added a bunch of suggestions. If those are accepted I am coming around to this PR.

FYI However I still think it would be useful to have a separate "Stream Rate Protocol" microservice and cross link.
That would cover this command and all the others - such as requesting a message and getting he current interval.

ARYA-mgc and others added 3 commits September 8, 2026 15:18
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
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.

3 participants