diff --git a/apps/attitude_estimator_ekf/Makefile b/apps/attitude_estimator_ekf/Makefile deleted file mode 100755 index 734af7cc1c..0000000000 --- a/apps/attitude_estimator_ekf/Makefile +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################ -# -# Copyright (C) 2012 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. -# -############################################################################ - -APPNAME = attitude_estimator_ekf -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 - -CSRCS = attitude_estimator_ekf_main.c \ - attitude_estimator_ekf_params.c \ - codegen/eye.c \ - codegen/attitudeKalmanfilter.c \ - codegen/mrdivide.c \ - codegen/rdivide.c \ - codegen/attitudeKalmanfilter_initialize.c \ - codegen/attitudeKalmanfilter_terminate.c \ - codegen/rt_nonfinite.c \ - codegen/rtGetInf.c \ - codegen/rtGetNaN.c \ - codegen/norm.c \ - codegen/cross.c - - -# XXX this is *horribly* broken -INCLUDES += $(TOPDIR)/../mavlink/include/mavlink - -include $(APPDIR)/mk/app.mk diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index 4dd2a2257d..c7109f213c 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -16,6 +16,11 @@ MODULES += drivers/lsm303d MODULES += drivers/l3gd20 MODULES += systemcmds/eeprom +# +# Estimation modules (EKF / other filters) +# +MODULES += modules/attitude_estimator_ekf + # # Transitional support - add commands from the NuttX export archive. # @@ -32,7 +37,6 @@ endef BUILTIN_COMMANDS := \ $(call _B, adc, , 2048, adc_main ) \ $(call _B, ardrone_interface, SCHED_PRIORITY_MAX-15, 2048, ardrone_interface_main ) \ - $(call _B, attitude_estimator_ekf, , 2048, attitude_estimator_ekf_main) \ $(call _B, bl_update, , 4096, bl_update_main ) \ $(call _B, blinkm, , 2048, blinkm_main ) \ $(call _B, bma180, , 2048, bma180_main ) \ diff --git a/makefiles/config_px4fmuv2_default.mk b/makefiles/config_px4fmuv2_default.mk index f86604a735..659b9c95be 100644 --- a/makefiles/config_px4fmuv2_default.mk +++ b/makefiles/config_px4fmuv2_default.mk @@ -17,6 +17,11 @@ MODULES += drivers/px4fmu MODULES += drivers/rgbled MODULES += systemcmds/ramtron +# +# Estimation modules (EKF / other filters) +# +MODULES += modules/attitude_estimator_ekf + # # Transitional support - add commands from the NuttX export archive. # @@ -32,7 +37,6 @@ endef # command priority stack entrypoint BUILTIN_COMMANDS := \ $(call _B, adc, , 2048, adc_main ) \ - $(call _B, attitude_estimator_ekf, , 2048, attitude_estimator_ekf_main) \ $(call _B, bl_update, , 4096, bl_update_main ) \ $(call _B, blinkm, , 2048, blinkm_main ) \ $(call _B, boardinfo, , 2048, boardinfo_main ) \ diff --git a/apps/attitude_estimator_ekf/attitude_estimator_ekf_main.c b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.c similarity index 99% rename from apps/attitude_estimator_ekf/attitude_estimator_ekf_main.c rename to src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.c index bd972f03f3..9fc4dfc838 100755 --- a/apps/attitude_estimator_ekf/attitude_estimator_ekf_main.c +++ b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include diff --git a/apps/attitude_estimator_ekf/attitude_estimator_ekf_params.c b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c similarity index 100% rename from apps/attitude_estimator_ekf/attitude_estimator_ekf_params.c rename to src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.c diff --git a/apps/attitude_estimator_ekf/attitude_estimator_ekf_params.h b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.h similarity index 100% rename from apps/attitude_estimator_ekf/attitude_estimator_ekf_params.h rename to src/modules/attitude_estimator_ekf/attitude_estimator_ekf_params.h diff --git a/apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter.c b/src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter.c rename to src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter.c diff --git a/apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter.h b/src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter.h rename to src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter.h diff --git a/apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.c b/src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.c rename to src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.c diff --git a/apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.h b/src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.h rename to src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.h diff --git a/apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.c b/src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.c rename to src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.c diff --git a/apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.h b/src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.h rename to src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.h diff --git a/apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_types.h b/src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_types.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_types.h rename to src/modules/attitude_estimator_ekf/codegen/attitudeKalmanfilter_types.h diff --git a/apps/attitude_estimator_ekf/codegen/cross.c b/src/modules/attitude_estimator_ekf/codegen/cross.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/cross.c rename to src/modules/attitude_estimator_ekf/codegen/cross.c diff --git a/apps/attitude_estimator_ekf/codegen/cross.h b/src/modules/attitude_estimator_ekf/codegen/cross.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/cross.h rename to src/modules/attitude_estimator_ekf/codegen/cross.h diff --git a/apps/attitude_estimator_ekf/codegen/eye.c b/src/modules/attitude_estimator_ekf/codegen/eye.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/eye.c rename to src/modules/attitude_estimator_ekf/codegen/eye.c diff --git a/apps/attitude_estimator_ekf/codegen/eye.h b/src/modules/attitude_estimator_ekf/codegen/eye.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/eye.h rename to src/modules/attitude_estimator_ekf/codegen/eye.h diff --git a/apps/attitude_estimator_ekf/codegen/mrdivide.c b/src/modules/attitude_estimator_ekf/codegen/mrdivide.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/mrdivide.c rename to src/modules/attitude_estimator_ekf/codegen/mrdivide.c diff --git a/apps/attitude_estimator_ekf/codegen/mrdivide.h b/src/modules/attitude_estimator_ekf/codegen/mrdivide.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/mrdivide.h rename to src/modules/attitude_estimator_ekf/codegen/mrdivide.h diff --git a/apps/attitude_estimator_ekf/codegen/norm.c b/src/modules/attitude_estimator_ekf/codegen/norm.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/norm.c rename to src/modules/attitude_estimator_ekf/codegen/norm.c diff --git a/apps/attitude_estimator_ekf/codegen/norm.h b/src/modules/attitude_estimator_ekf/codegen/norm.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/norm.h rename to src/modules/attitude_estimator_ekf/codegen/norm.h diff --git a/apps/attitude_estimator_ekf/codegen/rdivide.c b/src/modules/attitude_estimator_ekf/codegen/rdivide.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rdivide.c rename to src/modules/attitude_estimator_ekf/codegen/rdivide.c diff --git a/apps/attitude_estimator_ekf/codegen/rdivide.h b/src/modules/attitude_estimator_ekf/codegen/rdivide.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rdivide.h rename to src/modules/attitude_estimator_ekf/codegen/rdivide.h diff --git a/apps/attitude_estimator_ekf/codegen/rtGetInf.c b/src/modules/attitude_estimator_ekf/codegen/rtGetInf.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rtGetInf.c rename to src/modules/attitude_estimator_ekf/codegen/rtGetInf.c diff --git a/apps/attitude_estimator_ekf/codegen/rtGetInf.h b/src/modules/attitude_estimator_ekf/codegen/rtGetInf.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rtGetInf.h rename to src/modules/attitude_estimator_ekf/codegen/rtGetInf.h diff --git a/apps/attitude_estimator_ekf/codegen/rtGetNaN.c b/src/modules/attitude_estimator_ekf/codegen/rtGetNaN.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rtGetNaN.c rename to src/modules/attitude_estimator_ekf/codegen/rtGetNaN.c diff --git a/apps/attitude_estimator_ekf/codegen/rtGetNaN.h b/src/modules/attitude_estimator_ekf/codegen/rtGetNaN.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rtGetNaN.h rename to src/modules/attitude_estimator_ekf/codegen/rtGetNaN.h diff --git a/apps/attitude_estimator_ekf/codegen/rt_defines.h b/src/modules/attitude_estimator_ekf/codegen/rt_defines.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rt_defines.h rename to src/modules/attitude_estimator_ekf/codegen/rt_defines.h diff --git a/apps/attitude_estimator_ekf/codegen/rt_nonfinite.c b/src/modules/attitude_estimator_ekf/codegen/rt_nonfinite.c similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rt_nonfinite.c rename to src/modules/attitude_estimator_ekf/codegen/rt_nonfinite.c diff --git a/apps/attitude_estimator_ekf/codegen/rt_nonfinite.h b/src/modules/attitude_estimator_ekf/codegen/rt_nonfinite.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rt_nonfinite.h rename to src/modules/attitude_estimator_ekf/codegen/rt_nonfinite.h diff --git a/apps/attitude_estimator_ekf/codegen/rtwtypes.h b/src/modules/attitude_estimator_ekf/codegen/rtwtypes.h similarity index 100% rename from apps/attitude_estimator_ekf/codegen/rtwtypes.h rename to src/modules/attitude_estimator_ekf/codegen/rtwtypes.h diff --git a/src/modules/attitude_estimator_ekf/module.mk b/src/modules/attitude_estimator_ekf/module.mk new file mode 100644 index 0000000000..4033617c4b --- /dev/null +++ b/src/modules/attitude_estimator_ekf/module.mk @@ -0,0 +1,16 @@ + +MODULE_NAME = attitude_estimator_ekf +SRCS = attitude_estimator_ekf_main.c \ + attitude_estimator_ekf_params.c \ + codegen/attitudeKalmanfilter_initialize.c \ + codegen/attitudeKalmanfilter_terminate.c \ + codegen/attitudeKalmanfilter.c \ + codegen/cross.c \ + codegen/eye.c \ + codegen/mrdivide.c \ + codegen/norm.c \ + codegen/rdivide.c \ + codegen/rt_nonfinite.c \ + codegen/rtGetInf.c \ + codegen/rtGetNaN.c +