Commit Graph

69 Commits

Author SHA1 Message Date
Matthias Grob 4e3bd4f196 MAVSDK tests: shorten Position, Altitude control flights
We get more than 5 meter away much quicker.
2024-02-22 15:29:13 +01:00
Matthias Grob 0cc4b41a51 MAVSDK test: Fix fly_forward_in_altctl() timing 2024-02-22 15:29:13 +01:00
PerFrivik 9b122adae4 Fix fly_forward_in_posctl() timing 2024-02-22 15:29:13 +01:00
Silvan Fuhrer 5efcde7412 mavsdk_tests: add two new tests for VTOLs
- add functionality to specify world name for simulation in case name
- add test for triggering an airspeed invalidation in case of pitot blockage
- add test for high wind (ramped up wind over short period) to NOT invalidate airspeed in this case

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-11-09 09:42:43 +01:00
Konrad e3473a0f90 mavsdk_tests: Add integration tests for figure of 8 2023-10-31 15:57:59 -04:00
Konrad 654e885003 mavsdk: Add integration tests for RTL with approaches 2023-10-31 14:16:02 +01:00
Konrad 24f59dd465 autopilot_tester: Add mavlink passthrough to end custom commands 2023-10-31 14:16:02 +01:00
RomanBapst 6fca984c3f test_vtol_mission: Add additional testing for VTOL RTL and reverse mission RTL
mavsdk-test: added a vtol mission without a landing at the end (used for reversed RTL)
math_helpers: added function to compute local position from a raw mission item

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2023-09-29 14:25:03 +02:00
Beat Küng 57297234e2 autopilot_tester: slower descend for fly_forward_in_offboard_attitude
As CI was sometimes failing
2023-08-08 12:28:52 -04:00
Beat Küng 0277a6486f mavsdk_tests: add offboard attitude test & run with Q estimator 2023-08-04 11:27:31 -04:00
Junwoo Hwang 3e35f948d8 autopilot_tester: Make `wait_until_ready` also wait until vehicle can
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
2022-11-08 11:53:43 +13:00
bresch 6833c7e311 ekf2: adjust ekf2 aid parameters in configs 2022-08-24 09:16:11 -04:00
Alessandro Simovic de1fa11e96 New follow-me flight task
rename follow_me_status to follow_target_status

enable follow_target_estimator on skynode

implement the responsiveness parameter:
The responsiveness parameter should behave similarly to the previous
follow-me implementation in navigator. The difference here is that
there are now two separate gains for position and velocity fusion.
The previous implemenation in navigator had no velocity fusion.

Allow follow-me to be flown without RC

SITL tests for follow-me flight task

This includes:
- Testing the setting for the follow-me angle
- Testing that streaming position only or position
  and velocity measurements both work
- Testing that RC override works

Most of these tests are done with a simulated model
of a point object that moves on a straight line. So
nothing too spectacular. But it makes the test checks
much easier.

Since the estimator for the target actually checks new
measurements and compares them to old ones, I also added
random gausian noise to the measurements with a fixed seed
for deterministic randomness. So repeated runs produce
exactly the same results over and over.

Half of the angles are still missing in MAVSDK. Need to create
an upstream PR to add center left/right and rear left/right options.
These and the corresponding SITL tests need to be implemented
later.

sitl: Increase position tolerance during follow-me

Astro seems to barely exceed the current tolerance (4.3 !< 4.0)
causing CI to fail. The point of the CI test is not to check
the accuracy of the flight behaviour, but only the fact that the
drone is doing the expected thing. So the exact value of this
tolerance is not really important.

follow-me: gimbal control in follow-me

follow-me: create sub-routines in flight task class

follow-me: use ground-dist for emergency ascent

dist_bottom is only defined when a ground facing distance sensor exist.
It's therefore better to use dist_ground instead, which has the distance
to the home altitude if no distance sensor is available.

As a consequence it will only be possible to use follow-me in a valley
when the drone has a distance sensor.

follow-me: point gimbal to the ground in 2D mode

follow-me: another fuzzy msg handling for the estimator

follow-me: bugfix in acceleration saturation limit

follow-me: parameter for filter delay compensation

mantis: dont use flow for terrain estimation

follow-me: default responsiveness 0.5 -> 0.1

0.5 is way too jerky in real and simulated tests.

flight_task: clarify comments for bottom distance

follow-me: minor comment improvement

follow-me: [debug] log emergency_ascent

follow-me: [debug] log gimbal pitch

follow-me: [debug] status values for follow-me estimator

follow-me: setting for gimbal tracking mode

follow-me: release gimbal control at destruction

mavsdk: cosmetics 💄
2022-06-16 16:14:57 -04:00
Alessandro Simovic b5a3c58a95 sitl: loosen some timeouts
The typhoon_h480 model would not always complete takeoff in 30 seconds
or finish the mission within 60 seconds.
2022-05-12 07:58:56 +02:00
Alessandro Simovic 06f69cd469 Add SITL tests for control allocation 2022-05-12 07:58:56 +02:00
Julian Oes 07d75d85cf mavsdk_tests: trigger flush to stdout every second 2022-01-06 09:24:32 -05:00
Thomas Debrunner 9312c772f1 mavsdk-tests: Re-try to launch a mission for some time before failing. This mitigates an issue where the flight controller has an uploaded mission, but has not finished the mission feasibility checks yet. 2021-12-20 13:05:46 -05:00
benjinne 06a91ec752
Improve offboard failsafe (#18160)
* state_machine_helper: improve offboard failsafe

* state_machine_helper: add missing parameter to set_link_loss_nav_state

* state_machine_helper: fix no rc and offboard reason

* Fix offboard test by enabling rcl_except

* mavros_test fix offboard_posctl_test with rcl_except

* autopilot_tester make RcLossException bits explicit

Co-authored-by: Julian Oes <julian@oes.ch>

* autopilot_tester change rcl_except to rc_loss_exception

Co-authored-by: Julian Oes <julian@oes.ch>

* autopilot_tester fix rc_loss_exception renaming errors

Co-authored-by: Julian Oes <julian@oes.ch>
2021-09-08 18:19:53 +02:00
Julian Oes af50e25647 mavsdk_tests: update to MAVSDK v0.41.0
This required replacing some of the methods which had been deprecated
and now removed.
2021-07-23 09:05:31 +02:00
Julian Oes 4f52c0b6da mavsdk_tests: unused var and index fix 2021-04-29 21:08:33 -04:00
Julian Oes bb0fe9ee61 mavsdk_tests: losen time limit for VTOL mission 2021-04-06 11:35:18 -04:00
Julian Oes cd66a79747 mavsdk_tests: move waypoints to vehicle position
This way it shouldn't matter where the test is run.
2021-04-06 11:35:18 -04:00
Julian Oes d714c2faec mavsdk_tests: add VTOL mission tests
This adds VTOL mission tests to the CI integration tests.
This depends on MAVSDK v0.38.0.
2021-04-06 11:35:18 -04:00
Julian Oes 1e88939605 mavsdk_tests: report speed factor every second
This helps in debugging slow CI.
2021-04-06 11:35:18 -04:00
Julian Oes 2315618b85 mavsdk_tests: use autopilot timestamps to sleep
This way we should be able to avoid some of the timeouts happening on
the PX4 side if MAVSDK doesn't send setpoints in time.
2021-02-16 17:07:21 +01:00
Julian Oes 6c26387e85 mavsdk_tests: try to prevent auto-disarm
We should not spend too much time sending RC init messages because if it
takes too long, we might auto-disarm in the meantime.
2021-02-16 17:07:21 +01:00
Julian Oes 0ebb8c6981 mavsdk_tests: use microseconds to avoid sleep(0) 2021-02-16 17:07:21 +01:00
Julian Oes b6b9ce5f11 mavsdk_tests: robustify test by climbing longer 2021-02-16 17:07:21 +01:00
Julian Oes b79553862e mavsdk_tests: remove timeout for mission upload
Just use what is MAVSDK internal.
2021-02-16 17:07:21 +01:00
Julian Oes 4184c204c4 autopilot_tester: don't poll mission progress
Instead use subscription here as well in order not to miss an update.
2021-02-11 22:25:07 +01:00
Julian Oes 176d932f23 mavsdk_tests: prevent missing updates
It seems like we are often missing updates from topics like flight mode
or in air state, both topics that are sent out infrequenctly e.g. at 1
Hz. Therefore, instead of polling for that data we should probably
subscribe to the updates and that way get notified of each an every
update.

For instance this should prevent the case where we miss the mode change
from mission to descend and back to mission once landed and disarmed.
2021-02-10 16:37:02 -05:00
Julian Oes 397fa84cd0 mavsdk_tests: add time in front of debug lines 2021-02-09 11:32:41 +01:00
Daniel Agar a8f665739d mavsdk_tests: manual fly forward for slightly longer 2020-11-11 19:16:39 -05:00
Daniel Agar 76602b3a8f mavsdk_tests: longer climb (5 -> 10 seconds) in fly forward altctl/posctl tests 2020-10-10 20:03:50 -04:00
Julian Oes 012763e5f1 mavsdk_tests: fly forward a bit longer
Hopefully, that's long enough for slow VTOLs.
2020-09-16 12:51:56 -04:00
Julian Oes a299e2c57d mavsdk_tests: fly forward even longer
Hopefully that's enough.
2020-09-16 12:51:56 -04:00
Julian Oes 4c00c1f561 mavsdk_tests: add missing switch to POSCTL 2020-09-16 12:51:56 -04:00
Julian Oes bbef07bc80 mavsdk_tests: init RC with throttle centered 2020-09-16 12:51:56 -04:00
Julian Oes d2cb27e0de mavsdk_tests: try with faster RC rate 2020-09-16 12:51:56 -04:00
Julian Oes ca0f26a003 mavsdk_tests: added posctl/altctl test 2020-09-16 12:51:56 -04:00
Julian Oes a5a577a6c4 mavsdk_tests: use speed factor, increase timeouts
We had not actually properly adjusted the timeout to the lockstep speed
factor. Once we did that, we had to increase the timeouts quite a bit to
have the tests pass.
2020-09-16 12:51:56 -04:00
Julian Oes 4eb1ea10f0 mavsdk_tests: don't block inside of callback
This is required with MAVSDK v0.29.0 and later!
2020-09-16 12:51:56 -04:00
Julian Oes 55d2bdc438 mavsdk_tests: adapt to changed inject API
We now need to say which instance, for now it's all instances.
2020-09-16 12:51:56 -04:00
Julian Oes ed357cf356 mavsdk_tests: move math things to separate header 2020-09-16 12:51:56 -04:00
Julian Oes 1eaceb17dc mavsdk_tests: adjust timeouts by lockstep speed up 2020-09-16 12:51:56 -04:00
Julian Oes 20621e6744 mavsdk_tests: add tests for GPS as height source 2020-09-16 12:51:56 -04:00
Julian Oes c31246e13a mavsdk_tests: add test for stuck mag 2020-09-16 12:51:56 -04:00
Julian Oes afcfa2fbe0 mavsdk_tests: check for stuck baro 2020-09-16 12:51:56 -04:00
Julian Oes c4efcbf895 mavsdk_tests: check for baro failure in mission 2020-09-16 12:51:56 -04:00
Julian Oes 8d6ebf15b6 mavsdk_tests: test for losing mag during mission 2020-09-16 12:51:56 -04:00