libmavconn : enable low-latency mode on Linux #975
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some common USB-UART converters like the FTDI accumulate individual bytes from the serial link in order to send them in a single USB packet ("Nagling" - https://en.wikipedia.org/wiki/Nagle%27s_algorithm). This commit sets the ASYNC_LOW_LATENCY flag, which the FTDI kernel driver interprets as a request to drop the Nagling timer to 1ms (i.e send all accumulated bytes after 1ms.)
This reduces average link RTT to under 5ms at 921600 baud (it is 20-30 ms on master), and enables the use of mavros in systems where low latency is required to get good performance for e.g estimation and controls. As a side effect, this also greatly increases performance of timesync on serial links and prevents the hard-resets we've been seeing.