diff --git a/src/modules/ekf2/CMakeLists.txt b/src/modules/ekf2/CMakeLists.txt index c5f9c05fcf..de5390d3b1 100644 --- a/src/modules/ekf2/CMakeLists.txt +++ b/src/modules/ekf2/CMakeLists.txt @@ -126,7 +126,6 @@ list(APPEND EKF_SRCS EKF/fake_pos_control.cpp EKF/height_control.cpp EKF/imu_down_sampler.cpp - EKF/output_predictor.cpp EKF/velocity_fusion.cpp EKF/position_fusion.cpp EKF/yaw_fusion.cpp @@ -258,7 +257,9 @@ px4_add_module( EKF2Utility px4_work_queue world_magnetic_model + ${EKF_LIBS} + output_predictor UNITY_BUILD ) diff --git a/src/modules/ekf2/EKF/CMakeLists.txt b/src/modules/ekf2/EKF/CMakeLists.txt index a22e3816de..107f9ff4c2 100644 --- a/src/modules/ekf2/EKF/CMakeLists.txt +++ b/src/modules/ekf2/EKF/CMakeLists.txt @@ -31,6 +31,8 @@ # ############################################################################ +add_subdirectory(output_predictor) + set(EKF_LIBS) set(EKF_SRCS) list(APPEND EKF_SRCS @@ -44,7 +46,6 @@ list(APPEND EKF_SRCS fake_pos_control.cpp height_control.cpp imu_down_sampler.cpp - output_predictor.cpp velocity_fusion.cpp position_fusion.cpp yaw_fusion.cpp @@ -147,6 +148,7 @@ target_include_directories(ecl_EKF PUBLIC ${EKF_GENERATED_DERIVATION_INCLUDE_PAT target_link_libraries(ecl_EKF PRIVATE geo + output_predictor world_magnetic_model ${EKF_LIBS} ) diff --git a/src/modules/ekf2/EKF/estimator_interface.h b/src/modules/ekf2/EKF/estimator_interface.h index 5c757f7214..81f2dc48f3 100644 --- a/src/modules/ekf2/EKF/estimator_interface.h +++ b/src/modules/ekf2/EKF/estimator_interface.h @@ -64,7 +64,7 @@ #include "common.h" #include "RingBuffer.h" #include "imu_down_sampler.hpp" -#include "output_predictor.h" +#include "output_predictor/output_predictor.h" #if defined(CONFIG_EKF2_RANGE_FINDER) # include "aid_sources/range_finder/range_finder_consistency_check.hpp" diff --git a/src/modules/ekf2/EKF/output_predictor/CMakeLists.txt b/src/modules/ekf2/EKF/output_predictor/CMakeLists.txt new file mode 100644 index 0000000000..701a5cb13f --- /dev/null +++ b/src/modules/ekf2/EKF/output_predictor/CMakeLists.txt @@ -0,0 +1,39 @@ +############################################################################ +# +# Copyright (c) 2024 PX4 Development Team. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name PX4 nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +add_library(output_predictor + output_predictor.cpp + output_predictor.h +) + +add_dependencies(output_predictor prebuild_targets) diff --git a/src/modules/ekf2/EKF/output_predictor.cpp b/src/modules/ekf2/EKF/output_predictor/output_predictor.cpp similarity index 99% rename from src/modules/ekf2/EKF/output_predictor.cpp rename to src/modules/ekf2/EKF/output_predictor/output_predictor.cpp index 93086dc7e6..826717d7b8 100644 --- a/src/modules/ekf2/EKF/output_predictor.cpp +++ b/src/modules/ekf2/EKF/output_predictor/output_predictor.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2022 PX4. All rights reserved. + * Copyright (c) 2022-2024 PX4. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/src/modules/ekf2/EKF/output_predictor.h b/src/modules/ekf2/EKF/output_predictor/output_predictor.h similarity index 98% rename from src/modules/ekf2/EKF/output_predictor.h rename to src/modules/ekf2/EKF/output_predictor/output_predictor.h index ee5cc0f710..fee4fdff64 100644 --- a/src/modules/ekf2/EKF/output_predictor.h +++ b/src/modules/ekf2/EKF/output_predictor/output_predictor.h @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (c) 2022 PX4. All rights reserved. + * Copyright (c) 2022-2024 PX4. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -36,8 +36,7 @@ #include -#include "common.h" -#include "RingBuffer.h" +#include "../RingBuffer.h" #include