Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mavsdk test: Make wait_until_ready also wait until vehicle can arm #20489

Conversation

junwoo091400
Copy link
Contributor

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 that tester.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

image

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

@junwoo091400
Copy link
Contributor Author

CI build error for the standard_vtol with Address Sanitizer is a duplicate issue of #14835.

But since this failure mode is not understood yet, the CI failure can't be interpreted as a result of this PR itself. Most likely irrelevant.

julianoes
julianoes previously approved these changes Nov 2, 2022
Copy link
Contributor

@julianoes julianoes left a comment

Choose a reason for hiding this comment

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

Thanks, I think that make sense.

test/mavsdk_tests/autopilot_tester.cpp Outdated Show resolved Hide resolved
arm

- 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
- Also sometimes as vehicle didn't have manual control, it entered weird
states where it wasn't able to arm as well
- This adds a check to make sure vehicle is able to arm, directly from
the Health struct
@junwoo091400
Copy link
Contributor Author

@julianoes Good to merge? 😉

@julianoes julianoes merged commit 3e35f94 into PX4:main Nov 7, 2022
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.

2 participants