mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 10:26:52 +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(../..)
|
include_directories(../..)
|
||||||
|
|
||||||
# Add swig module
|
# 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})
|
swig_link_libraries(ecl_EKF ecl_EKF ${PYTHON_LIBRARIES})
|
||||||
|
|
||||||
# Files to install with Python
|
# 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
|
Increase the altitude with a bang-bang acceleration profile to target
|
||||||
altitude, then wait there for a while and make sure it converges
|
altitude, then wait there for a while and make sure it converges
|
||||||
"""
|
"""
|
||||||
# Due to hypothesis not interacting with pytest, cannot use fixture here
|
ekf = ecl_EKF.Ekf()
|
||||||
ekf, time_usec = initialized_ekf()
|
|
||||||
|
|
||||||
|
time_usec = 1000
|
||||||
dt_usec = ecl_EKF.Ekf.FILTER_UPDATE_PERIOD_MS * 1000
|
dt_usec = ecl_EKF.Ekf.FILTER_UPDATE_PERIOD_MS * 1000
|
||||||
|
|
||||||
# No samples, half are used for ramping up / down to the altitude
|
# Run for a while
|
||||||
n_samples = 200
|
n_samples = 10000
|
||||||
|
|
||||||
# Compute smooth acceleration profile
|
# Compute smooth acceleration profile
|
||||||
rampup_accel = altitude / (((n_samples // 2 // 2) * (dt_usec / 1e6))**2)
|
rampup_accel = altitude / (((n_samples // 2 // 2) * (dt_usec / 1e6))**2)
|
||||||
|
|||||||
Vendored
+7
-24
@@ -7,7 +7,7 @@ pipeline {
|
|||||||
stage('Linux GCC') {
|
stage('Linux GCC') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-base:2019-01-28'
|
image 'px4io/px4-dev-base:2019-01-31'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ pipeline {
|
|||||||
stage('Linux Clang') {
|
stage('Linux Clang') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-clang:2019-01-28'
|
image 'px4io/px4-dev-clang:2019-01-31'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,7 @@ pipeline {
|
|||||||
stage('coverage') {
|
stage('coverage') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-ecl:2019-01-28'
|
image 'px4io/px4-dev-ecl:2019-01-31'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ pipeline {
|
|||||||
stage('EKF pytest') {
|
stage('EKF pytest') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-ecl:2019-01-28'
|
image 'px4io/px4-dev-ecl:2019-01-31'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ pipeline {
|
|||||||
stage('test') {
|
stage('test') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-ecl:2019-01-28'
|
image 'px4io/px4-dev-ecl:2019-01-31'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,27 +137,10 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('test (asan)') {
|
|
||||||
agent {
|
|
||||||
docker {
|
|
||||||
image 'px4io/px4-dev-ecl:2019-01-28'
|
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
sh 'export'
|
|
||||||
sh 'ccache -z'
|
|
||||||
sh 'make distclean'
|
|
||||||
sh 'make test_asan'
|
|
||||||
sh 'ccache -s'
|
|
||||||
sh 'make distclean'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('doxygen') {
|
stage('doxygen') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-base:2019-01-28'
|
image 'px4io/px4-dev-base:2019-01-31'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -183,7 +166,7 @@ pipeline {
|
|||||||
stage('PX4/Firmware build') {
|
stage('PX4/Firmware build') {
|
||||||
agent {
|
agent {
|
||||||
docker {
|
docker {
|
||||||
image 'px4io/px4-dev-base:2019-01-28'
|
image 'px4io/px4-dev-base:2019-01-31'
|
||||||
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
args '-v ${CCACHE_DIR}:${CCACHE_DIR}:rw'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,19 +67,5 @@ using ecl_abstime = uint64_t;
|
|||||||
|
|
||||||
#endif /* PX4_POSIX || PX4_NUTTX */
|
#endif /* PX4_POSIX || PX4_NUTTX */
|
||||||
|
|
||||||
|
|
||||||
#if defined(__PX4_QURT)
|
|
||||||
|
|
||||||
// Missing math.h defines
|
|
||||||
#define ISFINITE(x) __builtin_isfinite(x)
|
|
||||||
|
|
||||||
#else /* !QuRT */
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#if defined(__cplusplus) && !defined(__PX4_NUTTX)
|
#define ISFINITE(x) __builtin_isfinite(x)
|
||||||
#define ISFINITE(x) std::isfinite(x)
|
|
||||||
#else
|
|
||||||
#define ISFINITE(x) isfinite(x)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
Reference in New Issue
Block a user