Mavsdk test: Make wait_until_ready
also wait until vehicle can arm
#20489
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.
Describe problem solved by this pull request
Previously, due to the way MAVSDK's
health_all_ok
was implemented, vehicle often didn't have a valid global position estimate (although function returned true), and it wouldn't arm, and the SITL would fail. This was originally reported here: mavlink/MAVSDK#1852 (comment)Also sometimes as vehicle didn't have manual control, it entered weird states where it wasn't able to arm as well.
Describe your solution
In
wait_until_ready()
, wait until we are able to arm, after checking system health. This ensures thattester.arm()
in mavsdk tests will succeed, since we know we will be able to arm, and SITL tests will not fail just because it can't arm.Test data / coverage
Standard VTOL mavsdk tests succeeded in local environment (wow it is slow when we don't have time factor!).
Additional context
Related: mavlink/MAVSDK#1852