From a561bf55c98bf823e09a57bf2a57e769a84cf2c8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 17 Nov 2023 17:03:28 +1100 Subject: [PATCH 1/3] AP_AHRS: compile EKF2 out by default on all boards --- libraries/AP_AHRS/AP_AHRS_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_AHRS/AP_AHRS_config.h b/libraries/AP_AHRS/AP_AHRS_config.h index 0be9f0cdd828b..559d0403b0566 100644 --- a/libraries/AP_AHRS/AP_AHRS_config.h +++ b/libraries/AP_AHRS/AP_AHRS_config.h @@ -16,8 +16,8 @@ #endif #ifndef HAL_NAVEKF2_AVAILABLE -// only default to EK2 enabled on boards with over 1M flash -#define HAL_NAVEKF2_AVAILABLE (BOARD_FLASH_SIZE>1024) +// EKF2 slated compiled out by default in 4.5, slated to be removed. +#define HAL_NAVEKF2_AVAILABLE 0 #endif #ifndef HAL_NAVEKF3_AVAILABLE From 90dd21b69084a6484b5bc56df600ee45333aa8ac Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Fri, 17 Nov 2023 17:07:30 +1100 Subject: [PATCH 2/3] waf: invert ekf2-disable command-line option --- Tools/ardupilotwaf/boards.py | 4 ++-- Tools/autotest/sim_vehicle.py | 6 +++--- wscript | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 776a1cd922372..017402f4d27c6 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -462,8 +462,8 @@ def configure_env(self, cfg, env): # We always want to use PRI format macros cfg.define('__STDC_FORMAT_MACROS', 1) - if cfg.options.disable_ekf2: - env.CXXFLAGS += ['-DHAL_NAVEKF2_AVAILABLE=0'] + if cfg.options.enable_ekf2: + env.CXXFLAGS += ['-DHAL_NAVEKF2_AVAILABLE=1'] if cfg.options.disable_ekf3: env.CXXFLAGS += ['-DHAL_NAVEKF3_AVAILABLE=0'] diff --git a/Tools/autotest/sim_vehicle.py b/Tools/autotest/sim_vehicle.py index 9540454e5231e..104331e1e27d4 100755 --- a/Tools/autotest/sim_vehicle.py +++ b/Tools/autotest/sim_vehicle.py @@ -378,8 +378,8 @@ def do_build(opts, frame_options): if opts.math_check_indexes: cmd_configure.append("--enable-math-check-indexes") - if opts.disable_ekf2: - cmd_configure.append("--disable-ekf2") + if opts.enable_ekf2: + cmd_configure.append("--enable-ekf2") if opts.disable_ekf3: cmd_configure.append("--disable-ekf3") @@ -1299,7 +1299,7 @@ def generate_frame_help(): group_sim.add_option("--fram-storage", action='store_true', help="use fram storage emulation") -group_sim.add_option("--disable-ekf2", +group_sim.add_option("--enable-ekf2", action='store_true', help="disable EKF2 in build") group_sim.add_option("--disable-ekf3", diff --git a/wscript b/wscript index a2e8a7347808c..19630462ecdd7 100644 --- a/wscript +++ b/wscript @@ -360,10 +360,10 @@ configuration in order to save typing. default=False, help='Use flash storage emulation.') - g.add_option('--disable-ekf2', + g.add_option('--enable-ekf2', action='store_true', default=False, - help='Configure without EKF2.') + help='Configure with EKF2.') g.add_option('--disable-ekf3', action='store_true', From b17942ca08eb3fb124bc54cc092d4a36ceb6a988 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sat, 18 Nov 2023 13:58:37 +1100 Subject: [PATCH 3/3] waf: keep EKF2 enabled in SITL just because we don't compile this in doesn't mean we shouldn't continue to test it --- Tools/ardupilotwaf/boards.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index 017402f4d27c6..04a2e11e7d301 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -654,6 +654,12 @@ def configure_env(self, cfg, env): cfg.define('AP_NOTIFY_LP5562_BUS', 2) cfg.define('AP_NOTIFY_LP5562_ADDR', 0x30) + try: + env.CXXFLAGS.remove('-DHAL_NAVEKF2_AVAILABLE=0') + except ValueError: + pass + env.CXXFLAGS += ['-DHAL_NAVEKF2_AVAILABLE=1'] + if self.with_can: cfg.define('HAL_NUM_CAN_IFACES', 2) env.DEFINES.update(CANARD_MULTI_IFACE=1,