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

CI fix 'Fly forward in position control' MAVSDK test #22775

Merged
merged 4 commits into from
Feb 22, 2024

Conversation

PerFrivik
Copy link
Contributor

@PerFrivik PerFrivik commented Feb 19, 2024

Solved Problem

image

This PR solves the issue of the CI SITL Tests failing for the iris, specifically when the 'Fly forward in position control' test is run.

To verify, run the following locally:

DONT_RUN=1 make px4_sitl gazebo-classic mavsdk_tests && test/mavsdk_tests/mavsdk_test_runner.py test/mavsdk_tests/configs/sitl.json --speed-factor 20 --model iris --iterations 100 --case 'Fly forward in position control'

Solution

These tests are written with the assumption, that PX4 will not switch to Position mode if it's not allowed to fly it yet. But now you can switch to Position mode even if it's not flyable yet when the vehicle is still disarmed. PX4 will actually automatically switch to position mode when there's stick input but we don't want to rely on that in this test.

Order:

  • Send stick input (manual control) because MAVSDK sets a flag that only allows switching to position if samples have been sent even though it would not be necessary for PX4
  • Switch to Position mode
  • Wait for things to be ready (this would include sticks being available now)
  • Fly the pattern

Alternatives

The test could be made faster because it's not necessary to fly 20+ seconds in one direction to get further than 5 meters away from home.

@PerFrivik PerFrivik self-assigned this Feb 19, 2024
@PerFrivik PerFrivik marked this pull request as draft February 19, 2024 16:41
@PerFrivik
Copy link
Contributor Author

rebased on main

@MaEtUgR MaEtUgR changed the title Fix fly_forward_in_posctl() timing CI fix 'Offboard position control' MAVSDK test Feb 19, 2024
@MaEtUgR
Copy link
Member

MaEtUgR commented Feb 19, 2024

I edited the description to contain the important points.

@MaEtUgR MaEtUgR changed the title CI fix 'Offboard position control' MAVSDK test CI fix 'Fly forward in position control' MAVSDK test Feb 19, 2024
@MaEtUgR
Copy link
Member

MaEtUgR commented Feb 19, 2024

@PerFrivik Do you have a reference to a pr or commit on main where this was failing in CI?

@MaEtUgR
Copy link
Member

MaEtUgR commented Feb 20, 2024

Push hotfix for altitude estimation issue in and merge after CI is passing.

This is a workaround to hotfix CI but the root cause is #22792
(MAVSDK test failing after EKF change, accelerometer simulation issues not learned anymore?)
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

image
but the root cause of the offboard inaccuracy stays and needs to be fixed separately: #22792

@MaEtUgR MaEtUgR marked this pull request as ready for review February 22, 2024 14:16
@MaEtUgR
Copy link
Member

MaEtUgR commented Feb 22, 2024

@PerFrivik @sfuhrer The VTOL wind one you started looking into should be the last one 😅
image

@MaEtUgR MaEtUgR merged commit 4e3bd4f into main Feb 22, 2024
91 of 92 checks passed
@MaEtUgR MaEtUgR deleted the pr-fix_fly_forward_in_posctl branch February 22, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants