Commit Graph

320 Commits

Author SHA1 Message Date
Balduin 6974c4a5cb AutopilotTester: Speed up polling w speed factor
If sim is running faster, we should also poll faster to keep the
same timing resolution. This fixed quite a large number of test
failures.
2025-11-24 09:13:16 -08:00
Balduin e4f4d240b6 last few hacks to make standard_vtol pass
- higher airspeed targets
 - higher pusher thrust
 - higher takeoff attitude (arsp failure test)

   in the airspeed failure case, the lowered airspeed reading causes the
   controller to want to speed up until the (wrong) airspeed is at the
   setpoint, i.e. the real airspeed quite a bit faster.  without these
   fixes, tecs does a nosedive to regain airspeed, but never becomes fast
   enough (with already maxed out pusher thrust). we pervent this with
   the first two adaptations, while the last one gives space for the
   remaining nosedive.

   fix this permanently by:
    - ensuring the model makes sense definitely (pusher thrust, mass, aero
      properties)
    - noticing the failure faster
    - adapting tecs so it doesn't nosedive?

 - stop sending airspeed in sih

   src/modules/simulation/sensor_airspeed_sim/SensorAirspeedSim.cpp
   is already doing that. in the sensor failure case (wrong), that implements
   the failure, but the SIH one not, giving conflicting data. so switch
   it off

 - larger acceptance radius

   quadx position mode is just not that accurate. is it a control/model
   mismatch problem, or a simulation problem?

 - wait longer for disarm in test_vtol_rtl

   this would fail at large speed factors previously. timing bug or
   acceptable small variation?
2025-11-24 09:13:14 -08:00
Balduin 6d5832b67a figure 8 test: longer transition timeout, no sleep
maybe this is a band-aid fix, and we actually should make sure the
transition can be achieved in the given 5 seconds, as it is very
reliably in the corresponding gazebo test case. check:
 - does SIH_T_MAX make sense?
 - does SIH_MASS make sense?
 - and any other model parameters which are suspicious
2025-11-24 09:12:15 -08:00
Balduin 790b60f027 mavsdk tests: use tester sleep function
the original std::this_thread::sleep_for is with respect to host system
time which is different from autopilot time if speed factor != 1, if
some component runs slower than real time, or if debugging.
tester.sleep_for (which already existed) correctly sleeps w.r.t.
px4/simulation time.
2025-11-24 09:12:13 -08:00
Balduin 56e361197e specify timeout duration to wait for disarm 2025-11-24 09:09:44 -08:00
Balduin 5c08b11442 DataValidator: handle low noise scale
Previously, DataValidator would automatically reject sensor data as
stale if (almost) constant.

But if setting SIH_NOISE_SCALE = 0 for deterministic sim, constant
sensor data are to be expected.

This adds logic to not flag sensor values as stale if noise scale is
very small. If the sensor has *actually* gone stale with very low noise
scale, this means we cannot detect it anymore.
2025-11-24 09:08:45 -08:00
Balduin ce98211181 clean up comments 2025-11-24 09:08:45 -08:00
Balduin ddeb548bb2 add workflow for sih-sitl tests
also, fix tailsitter model so actuator signs follow convention
2025-11-24 09:08:17 -08:00
Balduin 345e5296cb (very wip) sitl-sih integration tests 2025-11-24 09:08:15 -08:00
Julian Oes ff06a206d1 mavsdk_tests: bump version to 3.11.1
This should now include the figure eight messages.
2025-11-20 23:23:40 -09:00
Julian Oes 46ed71fa5b mavsdk_tests: figure eight is in common now 2025-11-20 23:23:40 -09:00
Hamish Willee 7d509d832a Update to latest mavlink that includes support for WIP warnings (#25804)
* Update to latest mavlink that includes support for WIP warnings

* mavsdk_tests: pass build for now

We need this until the figure eight stuff has moved to common.

---------

Co-authored-by: Julian Oes <julian@oes.ch>
2025-10-29 12:43:10 +11:00
Beat Küng 3d1cace7b7 test: add google fuzztest to unit test build
From https://github.com/google/fuzztest.
This will now also add gtest (via cmake FetchContent)

And requires newer cmake (container updates):
CMake 3.19 or higher is required.  You are running version 3.16.3
2025-07-11 10:39:28 +02:00
mahima-yoga ee953640ee MAVSDK: bump version to 3.7.0 2025-07-09 07:43:20 +12:00
Julian Oes bfbd9bfe27 mavsdk_test: fix mission timeout check
We shouldn't adjust for lockstep speedup twice.
2025-06-30 09:20:44 -07:00
Julian Oes d03b1171f9 mavsdk_tests: fix mission finished state
This is an attempt to use MAVSDK's is_mission_finished APIs instead.
2025-06-30 09:20:44 -07:00
Julian Oes 4126dde11f mavsdk_tests: bump to v3.4.0
This should fix some of the lockups and segfaults we see.
2025-05-19 07:37:02 -07:00
Julian Oes d4be5d3ff0 mavsdk_tests: add events to log 2025-05-19 07:37:02 -07:00
Julian Oes 1f65cc46b9 mavsdk_tests: bump MAVSDK to v3.3.4 2025-05-19 07:37:02 -07:00
Julian Oes 56eb9bcc18 mavsdk_tests: workaround race condition
PX4 needs a bit of time to process an uploaded mission before it is
ready to accept the mission mode.

Therefore, we need to wait a bit.

Alternatively, we could wait on the mission progress arriving properly,
but this sleep is simple enough for now.
2025-05-19 07:37:02 -07:00
Julian Oes e19d245355 mavsdk_tests: remove hacks for rally points
We can now just use MAVSDK to upload rally points.
2025-05-19 07:37:02 -07:00
Julian Oes 66deae172d mavsdk_tests: update to MAVSDK 3.0.0 2025-05-19 07:37:02 -07:00
GuillaumeLaine ba35ca461c ci: add external navigation integration tests 2025-04-04 09:12:53 +02:00
Beat Küng 0e4c794674 ros_tests: change filter to use all tests
The name is being changed in https://github.com/Auterion/px4-ros2-interface-lib/pull/8
2025-04-04 09:12:53 +02:00
Beat Küng 3d6056411f integration tests: add --force-color & set in CI
github actions supports color output, but does not report as a tty.
See https://github.com/actions/runner/issues/241.
2025-04-04 09:12:53 +02:00
Beat Küng a954ec4d55 test: add ros integration test runner script & config 2025-04-04 09:12:53 +02:00
Beat Küng 7c14a63855 refactor mavsdk_tests: move code into separate classes & extract mavsdk-specifics
Allows it to be reused for other integration tests, like ros.
2025-04-04 09:12:53 +02:00
Beat Küng d78af5436e mavsdk_tests: highlight px4 errors & reset color on gazebo output 2025-04-04 09:12:53 +02:00
Beat Küng 45285a57ad fix mavsdk_tests: add ',' to test_filter config 2025-04-04 09:12:53 +02:00
Beat Küng bbcd153e94 sitl: add generic way to override params via ENV variables 2025-04-04 09:12:53 +02:00
Jacob Dahl 4c0a63f679 mavsdk_tests: add multicopter alt hold test (#24396)
* mavsdk_tests: add multicopter alt hold test

* fix test filter

* increase altitude tolerance to 10m as a test

* reduce to 1m tolerance

* increase to 5m tolerance

* increase to 2m tolerance

* reduce back to 1m

* delay 60 seconds

* fix log upload

* fix ulog upload path

* make altitude tolerance in tester.wait_until_altitude configurable

* fix lambda

* default arg in declaration

* tighten up tolerance
2025-03-21 16:21:10 -06:00
Balduin c0100ed4e7 mavsdk tests: use tester sleep_for function
the previously used std::this_thread::sleep_for is with respect to host
system time which is different from autopilot time if:

 - speed factor != 1
 - something runs slower than realtime regardless of speed factor
 - debugging or otherwise interrupting PX4 control code

tester.sleep_for (which already existed) correctly sleeps w.r.t.
px4/simulation time.
2025-03-18 10:25:38 +01:00
Matthias Grob ed9111ec49 Remove obstacle avoidance test with Gazebo classic and ROS 1 2025-02-18 14:33:16 +01:00
Silvan Fuhrer 58d3e1ea8e test: in VTOL integration test use VTOL_LAND (#24261)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-01-28 11:22:51 +01:00
Daniel Agar 7288d16855 mavsdk_tests set nice levels for px4/gzclient/mavsdk_tests 2024-11-20 14:45:11 -05:00
Daniel Agar 635e162a0c test/mavsdk_tests: continue sending manual control between steps in fly_forward_in_posctl()/fly_forward_in_altctl() 2024-11-20 09:36:06 -08:00
Jacob Dahl ed3cac9122 tests: increase timeout for armable check 2024-11-05 21:13:10 -05:00
Ramon Roche 16c77be7c0 tests: loosen radius of vtol rtl landing pos check 2024-08-26 14:05:17 -04:00
Matthias Grob f2bca92221 Fix duplicate newlines at the end of files 2024-07-19 14:33:36 +02:00
Silvan Fuhrer 0379048ad2 mavsdk_tests: increase acceptance radius for position check on offboard landing
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-05-29 20:46:26 -04:00
Silvan Fuhrer 97191bd60f autopilot_tester: for mission end timeout check take speed factor into account
And increase the (simulation time) timeouts.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-04-23 16:37:31 +02:00
Silvan Fuhrer 818e318334 autopilot_tester: reduce mission distance for wind world
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-04-23 16:37:31 +02:00
Silvan Fuhrer 59232c27ae autopilot_tester: use normal VTOL mission for airspeed blockage test
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-04-23 16:37:31 +02:00
Daniel Agar 78bbb66568 delete SYS_MC_EST_GROUP
- introduce per module parameters (EKF2_EN, LPE_EN, ATT_EN)
 - add basic checks to prevent EKF2 + LPE running simultaneously
2024-04-15 16:06:08 -04:00
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
Matthias Grob f602228048 MAVSDK test: increase offboard position threshold
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?)
2024-02-22 15:29:13 +01:00
PerFrivik 9b122adae4 Fix fly_forward_in_posctl() timing 2024-02-22 15:29:13 +01:00
Matthias Grob 75bb25a44c test_vtol_figure_eight: fix altitude check
wait_until_altitude() checks for absolute altitude being
close so checking for 1m below the setpoint can fail
if the speedup results in no sample inside the altitude
window being checked.

Ideally the test could check if the takeoff is done directly
instead of comparing altitudes in the first place.
2023-12-12 20:22:23 +01:00
Konrad 9387de8282 mavsdk figure 8 test: Increase time of timeout 2023-11-22 16:47:38 -05:00