mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 12:53:34 +08:00
EKF tests update SWIG usage and use latest containers
This commit is contained in:
@@ -14,7 +14,10 @@ set_source_files_properties(../ecl_EKF.i PROPERTIES CPLUSPLUS ON)
|
||||
include_directories(../..)
|
||||
|
||||
# Add swig module
|
||||
swig_add_module(ecl_EKF python ../ecl_EKF.i)
|
||||
swig_add_library(ecl_EKF
|
||||
LANGUAGE python
|
||||
SOURCES ../ecl_EKF.i
|
||||
)
|
||||
swig_link_libraries(ecl_EKF ecl_EKF ${PYTHON_LIBRARIES})
|
||||
|
||||
# Files to install with Python
|
||||
|
||||
@@ -133,13 +133,13 @@ def test_converges_to_baro_altitude(altitude):
|
||||
Increase the altitude with a bang-bang acceleration profile to target
|
||||
altitude, then wait there for a while and make sure it converges
|
||||
"""
|
||||
# Due to hypothesis not interacting with pytest, cannot use fixture here
|
||||
ekf, time_usec = initialized_ekf()
|
||||
ekf = ecl_EKF.Ekf()
|
||||
|
||||
time_usec = 1000
|
||||
dt_usec = ecl_EKF.Ekf.FILTER_UPDATE_PERIOD_MS * 1000
|
||||
|
||||
# No samples, half are used for ramping up / down to the altitude
|
||||
n_samples = 200
|
||||
# Run for a while
|
||||
n_samples = 10000
|
||||
|
||||
# Compute smooth acceleration profile
|
||||
rampup_accel = altitude / (((n_samples // 2 // 2) * (dt_usec / 1e6))**2)
|
||||
|
||||
Reference in New Issue
Block a user