mavsdk_server: default to the first autopilot #2159
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.
Currently,
mavsdk_server
defaults to being a ground station (i.e. it does not expose theConfiguration
). When started,mavsdk_server
connects to the first MAVLinkSystem
it detects.The problem I have seen is that in some setups, there are sometimes MAVLink systems that are not an autopilot but that are advertising on the link that
mavsdk_server
is listening to. I had the issue with a Herelink radio, that advertises radio messages with sysid 42. For an app running on Herelink, ifmavsdk_server
picks up the system "42" first, then there is nothing to do other than restarting it and hoping that it picks up the right system.Now I argue that the "right" system for
mavsdk_server
, given the current situation where it defaults to being a ground station, is a system that has an autopilot (i.e. a drone).This PR makes
mavsdk_server
connect not to the first system it encounters, but to the first drone (a.k.a. "system with an autopilot") it encounters.