From 1becedfe011d02120fe68b549f8c3a02e0a979c7 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 13:41:40 +0200 Subject: [PATCH 1/6] Minor config file rearrangement --- makefiles/config_px4fmu_default.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index aae7e9b0e1..57d9492583 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -10,11 +10,11 @@ ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common # # Board support modules # +MODULES += drivers/px4io MODULES += drivers/px4fmu MODULES += drivers/boards/px4fmu -MODULES += drivers/l3gd20 MODULES += drivers/ardrone_interface -MODULES += drivers/px4io +MODULES += drivers/l3gd20 MODULES += modules/sensors # From 5974c37abba562c1372beb04490014db274fd175 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 14:06:23 +0200 Subject: [PATCH 2/6] Moved the bulk of sensor drivers to the new world --- apps/drivers/mpu6000/Makefile | 42 ----------------- apps/hott_telemetry/Makefile | 45 ------------------- makefiles/config_px4fmu_default.mk | 17 +++---- {apps => src}/drivers/blinkm/blinkm.cpp | 0 .../Makefile => src/drivers/blinkm/module.mk | 8 ++-- {apps => src}/drivers/bma180/bma180.cpp | 0 .../Makefile => src/drivers/bma180/module.mk | 8 ++-- {apps => src}/drivers/gps/gps.cpp | 0 {apps => src}/drivers/gps/gps_helper.cpp | 0 {apps => src}/drivers/gps/gps_helper.h | 0 .../gps/Makefile => src/drivers/gps/module.mk | 11 ++--- {apps => src}/drivers/gps/mtk.cpp | 0 {apps => src}/drivers/gps/mtk.h | 0 {apps => src}/drivers/gps/ubx.cpp | 0 {apps => src}/drivers/gps/ubx.h | 0 {apps => src}/drivers/hil/hil.cpp | 0 .../Makefile => src/drivers/hil/module.mk | 10 ++--- {apps => src}/drivers/hmc5883/hmc5883.cpp | 0 .../Makefile => src/drivers/hmc5883/module.mk | 13 +++--- .../hott_telemetry/hott_telemetry_main.c | 12 ++--- .../drivers}/hott_telemetry/messages.c | 6 +-- .../drivers}/hott_telemetry/messages.h | 5 ++- src/drivers/hott_telemetry/module.mk | 41 +++++++++++++++++ {apps => src}/drivers/mb12xx/mb12xx.cpp | 2 +- .../Makefile => src/drivers/mb12xx/module.mk | 8 ++-- src/drivers/mpu6000/module.mk | 43 ++++++++++++++++++ {apps => src}/drivers/mpu6000/mpu6000.cpp | 2 +- .../Makefile => src/drivers/ms5611/module.mk | 8 ++-- {apps => src}/drivers/ms5611/ms5611.cpp | 0 29 files changed, 133 insertions(+), 148 deletions(-) delete mode 100644 apps/drivers/mpu6000/Makefile delete mode 100644 apps/hott_telemetry/Makefile rename {apps => src}/drivers/blinkm/blinkm.cpp (100%) rename apps/drivers/blinkm/Makefile => src/drivers/blinkm/module.mk (90%) rename {apps => src}/drivers/bma180/bma180.cpp (100%) rename apps/drivers/bma180/Makefile => src/drivers/bma180/module.mk (91%) rename {apps => src}/drivers/gps/gps.cpp (100%) rename {apps => src}/drivers/gps/gps_helper.cpp (100%) rename {apps => src}/drivers/gps/gps_helper.h (100%) rename apps/drivers/gps/Makefile => src/drivers/gps/module.mk (91%) rename {apps => src}/drivers/gps/mtk.cpp (100%) rename {apps => src}/drivers/gps/mtk.h (100%) rename {apps => src}/drivers/gps/ubx.cpp (100%) rename {apps => src}/drivers/gps/ubx.h (100%) rename {apps => src}/drivers/hil/hil.cpp (100%) rename apps/drivers/hmc5883/Makefile => src/drivers/hil/module.mk (89%) rename {apps => src}/drivers/hmc5883/hmc5883.cpp (100%) rename apps/drivers/hil/Makefile => src/drivers/hmc5883/module.mk (88%) rename {apps => src/drivers}/hott_telemetry/hott_telemetry_main.c (96%) rename {apps => src/drivers}/hott_telemetry/messages.c (94%) rename {apps => src/drivers}/hott_telemetry/messages.h (96%) create mode 100644 src/drivers/hott_telemetry/module.mk rename {apps => src}/drivers/mb12xx/mb12xx.cpp (99%) rename apps/drivers/mb12xx/Makefile => src/drivers/mb12xx/module.mk (91%) create mode 100644 src/drivers/mpu6000/module.mk rename {apps => src}/drivers/mpu6000/mpu6000.cpp (99%) rename apps/drivers/ms5611/Makefile => src/drivers/ms5611/module.mk (90%) rename {apps => src}/drivers/ms5611/ms5611.cpp (100%) diff --git a/apps/drivers/mpu6000/Makefile b/apps/drivers/mpu6000/Makefile deleted file mode 100644 index 32df1bdae7..0000000000 --- a/apps/drivers/mpu6000/Makefile +++ /dev/null @@ -1,42 +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. -# -############################################################################ - -# -# Makefile to build the BMA180 driver. -# - -APPNAME = mpu6000 -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 - -include $(APPDIR)/mk/app.mk diff --git a/apps/hott_telemetry/Makefile b/apps/hott_telemetry/Makefile deleted file mode 100644 index 8d5faa3b7f..0000000000 --- a/apps/hott_telemetry/Makefile +++ /dev/null @@ -1,45 +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. -# -############################################################################ - -# -# Graupner HoTT Telemetry application. -# - -# The following line is required for accessing UARTs directly. -INCLUDES = $(TOPDIR)/arch/arm/src/stm32 $(TOPDIR)/arch/arm/src/common - -APPNAME = hott_telemetry -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 - -include $(APPDIR)/mk/app.mk diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index 57d9492583..00aec3f8ae 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -15,6 +15,15 @@ MODULES += drivers/px4fmu MODULES += drivers/boards/px4fmu MODULES += drivers/ardrone_interface MODULES += drivers/l3gd20 +MODULES += drivers/bma180 +MODULES += drivers/mpu6000 +MODULES += drivers/hmc5883 +MODULES += drivers/ms5611 +MODULES += drivers/mb12xx +MODULES += drivers/gps +MODULES += drivers/hil +MODULES += drivers/hott_telemetry +MODULES += drivers/blinkm MODULES += modules/sensors # @@ -66,19 +75,11 @@ endef # command priority stack entrypoint BUILTIN_COMMANDS := \ $(call _B, adc, , 2048, adc_main ) \ - $(call _B, blinkm, , 2048, blinkm_main ) \ - $(call _B, bma180, , 2048, bma180_main ) \ $(call _B, control_demo, , 2048, control_demo_main ) \ $(call _B, fixedwing_att_control, SCHED_PRIORITY_MAX-30, 2048, fixedwing_att_control_main ) \ $(call _B, fixedwing_pos_control, SCHED_PRIORITY_MAX-30, 2048, fixedwing_pos_control_main ) \ - $(call _B, gps, , 2048, gps_main ) \ - $(call _B, hil, , 2048, hil_main ) \ - $(call _B, hmc5883, , 4096, hmc5883_main ) \ - $(call _B, hott_telemetry, , 2048, hott_telemetry_main ) \ $(call _B, kalman_demo, SCHED_PRIORITY_MAX-30, 2048, kalman_demo_main ) \ $(call _B, math_demo, , 8192, math_demo_main ) \ - $(call _B, mpu6000, , 4096, mpu6000_main ) \ - $(call _B, ms5611, , 2048, ms5611_main ) \ $(call _B, multirotor_att_control, SCHED_PRIORITY_MAX-15, 2048, multirotor_att_control_main) \ $(call _B, multirotor_pos_control, SCHED_PRIORITY_MAX-25, 2048, multirotor_pos_control_main) \ $(call _B, sercon, , 2048, sercon_main ) \ diff --git a/apps/drivers/blinkm/blinkm.cpp b/src/drivers/blinkm/blinkm.cpp similarity index 100% rename from apps/drivers/blinkm/blinkm.cpp rename to src/drivers/blinkm/blinkm.cpp diff --git a/apps/drivers/blinkm/Makefile b/src/drivers/blinkm/module.mk similarity index 90% rename from apps/drivers/blinkm/Makefile rename to src/drivers/blinkm/module.mk index 5a623693df..b48b90f3f4 100644 --- a/apps/drivers/blinkm/Makefile +++ b/src/drivers/blinkm/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -35,8 +35,6 @@ # BlinkM I2C LED driver # -APPNAME = blinkm -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = blinkm -include $(APPDIR)/mk/app.mk +SRCS = blinkm.cpp diff --git a/apps/drivers/bma180/bma180.cpp b/src/drivers/bma180/bma180.cpp similarity index 100% rename from apps/drivers/bma180/bma180.cpp rename to src/drivers/bma180/bma180.cpp diff --git a/apps/drivers/bma180/Makefile b/src/drivers/bma180/module.mk similarity index 91% rename from apps/drivers/bma180/Makefile rename to src/drivers/bma180/module.mk index cc01b629e6..4c60ee082c 100644 --- a/apps/drivers/bma180/Makefile +++ b/src/drivers/bma180/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -35,8 +35,6 @@ # Makefile to build the BMA180 driver. # -APPNAME = bma180 -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = bma180 -include $(APPDIR)/mk/app.mk +SRCS = bma180.cpp diff --git a/apps/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp similarity index 100% rename from apps/drivers/gps/gps.cpp rename to src/drivers/gps/gps.cpp diff --git a/apps/drivers/gps/gps_helper.cpp b/src/drivers/gps/gps_helper.cpp similarity index 100% rename from apps/drivers/gps/gps_helper.cpp rename to src/drivers/gps/gps_helper.cpp diff --git a/apps/drivers/gps/gps_helper.h b/src/drivers/gps/gps_helper.h similarity index 100% rename from apps/drivers/gps/gps_helper.h rename to src/drivers/gps/gps_helper.h diff --git a/apps/drivers/gps/Makefile b/src/drivers/gps/module.mk similarity index 91% rename from apps/drivers/gps/Makefile rename to src/drivers/gps/module.mk index 3859a88a5a..097db2abfc 100644 --- a/apps/drivers/gps/Makefile +++ b/src/drivers/gps/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -35,8 +35,9 @@ # GPS driver # -APPNAME = gps -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = gps -include $(APPDIR)/mk/app.mk +SRCS = gps.cpp \ + gps_helper.cpp \ + mtk.cpp \ + ubx.cpp diff --git a/apps/drivers/gps/mtk.cpp b/src/drivers/gps/mtk.cpp similarity index 100% rename from apps/drivers/gps/mtk.cpp rename to src/drivers/gps/mtk.cpp diff --git a/apps/drivers/gps/mtk.h b/src/drivers/gps/mtk.h similarity index 100% rename from apps/drivers/gps/mtk.h rename to src/drivers/gps/mtk.h diff --git a/apps/drivers/gps/ubx.cpp b/src/drivers/gps/ubx.cpp similarity index 100% rename from apps/drivers/gps/ubx.cpp rename to src/drivers/gps/ubx.cpp diff --git a/apps/drivers/gps/ubx.h b/src/drivers/gps/ubx.h similarity index 100% rename from apps/drivers/gps/ubx.h rename to src/drivers/gps/ubx.h diff --git a/apps/drivers/hil/hil.cpp b/src/drivers/hil/hil.cpp similarity index 100% rename from apps/drivers/hil/hil.cpp rename to src/drivers/hil/hil.cpp diff --git a/apps/drivers/hmc5883/Makefile b/src/drivers/hil/module.mk similarity index 89% rename from apps/drivers/hmc5883/Makefile rename to src/drivers/hil/module.mk index 4d7cb4e7b9..f8895f5d5a 100644 --- a/apps/drivers/hmc5883/Makefile +++ b/src/drivers/hil/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -32,11 +32,9 @@ ############################################################################ # -# HMC5883 driver +# Hardware in the Loop (HIL) simulation actuator output bank # -APPNAME = hmc5883 -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +MODULE_COMMAND = hil -include $(APPDIR)/mk/app.mk +SRCS = hil.cpp diff --git a/apps/drivers/hmc5883/hmc5883.cpp b/src/drivers/hmc5883/hmc5883.cpp similarity index 100% rename from apps/drivers/hmc5883/hmc5883.cpp rename to src/drivers/hmc5883/hmc5883.cpp diff --git a/apps/drivers/hil/Makefile b/src/drivers/hmc5883/module.mk similarity index 88% rename from apps/drivers/hil/Makefile rename to src/drivers/hmc5883/module.mk index 1fb6e37bce..07377556d3 100644 --- a/apps/drivers/hil/Makefile +++ b/src/drivers/hmc5883/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -32,11 +32,12 @@ ############################################################################ # -# Interface driver for the PX4FMU board +# HMC5883 driver # -APPNAME = hil -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = hmc5883 -include $(APPDIR)/mk/app.mk +# XXX seems excessive, check if 2048 is sufficient +MODULE_STACKSIZE = 4096 + +SRCS = hmc5883.cpp diff --git a/apps/hott_telemetry/hott_telemetry_main.c b/src/drivers/hott_telemetry/hott_telemetry_main.c similarity index 96% rename from apps/hott_telemetry/hott_telemetry_main.c rename to src/drivers/hott_telemetry/hott_telemetry_main.c index 31c9247aa5..a13a6ef589 100644 --- a/apps/hott_telemetry/hott_telemetry_main.c +++ b/src/drivers/hott_telemetry/hott_telemetry_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. - * Author: @author Simon Wilks + * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. + * Author: Simon Wilks * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +34,7 @@ /** * @file hott_telemetry_main.c + * @author Simon Wilks * * Graupner HoTT Telemetry implementation. * @@ -41,7 +42,6 @@ * a data packet can be returned if necessary. * * TODO: Add support for at least the vario and GPS sensor data. - * */ #include @@ -57,12 +57,6 @@ #include "messages.h" -/* The following are equired for UART direct manipulation. */ -#include -#include "up_arch.h" -#include "chip.h" -#include "stm32_internal.h" - static int thread_should_exit = false; /**< Deamon exit flag */ static int thread_running = false; /**< Deamon status flag */ static int deamon_task; /**< Handle of deamon task / thread */ diff --git a/apps/hott_telemetry/messages.c b/src/drivers/hott_telemetry/messages.c similarity index 94% rename from apps/hott_telemetry/messages.c rename to src/drivers/hott_telemetry/messages.c index 8bfb997737..5fbee16ce9 100644 --- a/apps/hott_telemetry/messages.c +++ b/src/drivers/hott_telemetry/messages.c @@ -1,7 +1,7 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. - * Author: @author Simon Wilks + * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. + * Author: Simon Wilks * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,7 +34,7 @@ /** * @file messages.c - * + * @author Simon Wilks */ #include "messages.h" diff --git a/apps/hott_telemetry/messages.h b/src/drivers/hott_telemetry/messages.h similarity index 96% rename from apps/hott_telemetry/messages.h rename to src/drivers/hott_telemetry/messages.h index 44001e04f0..dd38075fa8 100644 --- a/apps/hott_telemetry/messages.h +++ b/src/drivers/hott_telemetry/messages.h @@ -1,7 +1,7 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. - * Author: @author Simon Wilks + * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. + * Author: Simon Wilks * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +34,7 @@ /** * @file messages.h + * @author Simon Wilks * * Graupner HoTT Telemetry message generation. * diff --git a/src/drivers/hott_telemetry/module.mk b/src/drivers/hott_telemetry/module.mk new file mode 100644 index 0000000000..def1d59e9b --- /dev/null +++ b/src/drivers/hott_telemetry/module.mk @@ -0,0 +1,41 @@ +############################################################################ +# +# Copyright (c) 2012, 2013 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. +# +############################################################################ + +# +# Graupner HoTT Telemetry application. +# + +MODULE_COMMAND = hott_telemetry + +SRCS = hott_telemetry_main.c \ + messages.c diff --git a/apps/drivers/mb12xx/mb12xx.cpp b/src/drivers/mb12xx/mb12xx.cpp similarity index 99% rename from apps/drivers/mb12xx/mb12xx.cpp rename to src/drivers/mb12xx/mb12xx.cpp index 9d0f6bddcf..397686e8bf 100644 --- a/apps/drivers/mb12xx/mb12xx.cpp +++ b/src/drivers/mb12xx/mb12xx.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2013 PX4 Development Team. All rights reserved. + * Copyright (c) 2013 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 diff --git a/apps/drivers/mb12xx/Makefile b/src/drivers/mb12xx/module.mk similarity index 91% rename from apps/drivers/mb12xx/Makefile rename to src/drivers/mb12xx/module.mk index 0d24057877..4e00ada025 100644 --- a/apps/drivers/mb12xx/Makefile +++ b/src/drivers/mb12xx/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2013 PX4 Development Team. All rights reserved. +# Copyright (c) 2013 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 @@ -35,8 +35,6 @@ # Makefile to build the Maxbotix Sonar driver. # -APPNAME = mb12xx -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = mb12xx -include $(APPDIR)/mk/app.mk +SRCS = mb12xx.cpp diff --git a/src/drivers/mpu6000/module.mk b/src/drivers/mpu6000/module.mk new file mode 100644 index 0000000000..c7d9cd3ef1 --- /dev/null +++ b/src/drivers/mpu6000/module.mk @@ -0,0 +1,43 @@ +############################################################################ +# +# Copyright (c) 2012, 2013 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. +# +############################################################################ + +# +# Makefile to build the MPU6000 driver. +# + +MODULE_COMMAND = mpu6000 + +# XXX seems excessive, check if 2048 is not sufficient +MODULE_STACKSIZE = 4096 + +SRCS = mpu6000.cpp diff --git a/apps/drivers/mpu6000/mpu6000.cpp b/src/drivers/mpu6000/mpu6000.cpp similarity index 99% rename from apps/drivers/mpu6000/mpu6000.cpp rename to src/drivers/mpu6000/mpu6000.cpp index ce7062046f..df1958186f 100644 --- a/apps/drivers/mpu6000/mpu6000.cpp +++ b/src/drivers/mpu6000/mpu6000.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. + * Copyright (c) 2012, 2013 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 diff --git a/apps/drivers/ms5611/Makefile b/src/drivers/ms5611/module.mk similarity index 90% rename from apps/drivers/ms5611/Makefile rename to src/drivers/ms5611/module.mk index d8e67cba25..3c4b0f0938 100644 --- a/apps/drivers/ms5611/Makefile +++ b/src/drivers/ms5611/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -35,8 +35,6 @@ # MS5611 driver # -APPNAME = ms5611 -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = ms5611 -include $(APPDIR)/mk/app.mk +SRCS = ms5611.cpp diff --git a/apps/drivers/ms5611/ms5611.cpp b/src/drivers/ms5611/ms5611.cpp similarity index 100% rename from apps/drivers/ms5611/ms5611.cpp rename to src/drivers/ms5611/ms5611.cpp From 5514d6879ab3caae0458fe01da574d7e09b1b447 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 14:09:48 +0200 Subject: [PATCH 3/6] Docs changes --- apps/examples/kalman_demo/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/examples/kalman_demo/Makefile b/apps/examples/kalman_demo/Makefile index 99c34d934e..6c592d645c 100644 --- a/apps/examples/kalman_demo/Makefile +++ b/apps/examples/kalman_demo/Makefile @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -32,7 +32,7 @@ ############################################################################ # -# Basic example application +# Full attitude / position Extended Kalman Filter # APPNAME = kalman_demo From 76a30108d2eab6a65f5fc92e2f9550d25ad5656c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 14:16:34 +0200 Subject: [PATCH 4/6] Moved James Gopperts EKF to the new world --- makefiles/config_px4fmu_default.mk | 2 +- .../modules/att_pos_estimator_ekf}/KalmanNav.cpp | 0 .../modules/att_pos_estimator_ekf}/KalmanNav.hpp | 0 .../modules/att_pos_estimator_ekf/kalman_main.cpp | 4 ++-- .../modules/att_pos_estimator_ekf/module.mk | 11 +++++++---- .../modules/att_pos_estimator_ekf}/params.c | 0 6 files changed, 10 insertions(+), 7 deletions(-) rename {apps/examples/kalman_demo => src/modules/att_pos_estimator_ekf}/KalmanNav.cpp (100%) rename {apps/examples/kalman_demo => src/modules/att_pos_estimator_ekf}/KalmanNav.hpp (100%) rename apps/examples/kalman_demo/kalman_demo.cpp => src/modules/att_pos_estimator_ekf/kalman_main.cpp (96%) rename apps/examples/kalman_demo/Makefile => src/modules/att_pos_estimator_ekf/module.mk (89%) rename {apps/examples/kalman_demo => src/modules/att_pos_estimator_ekf}/params.c (100%) diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index 00aec3f8ae..0767f71447 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -54,6 +54,7 @@ MODULES += modules/mavlink_onboard # MODULES += modules/attitude_estimator_ekf MODULES += modules/position_estimator_mc +MODULES += modules/att_pos_estimator_ekf # # Logging @@ -78,7 +79,6 @@ BUILTIN_COMMANDS := \ $(call _B, control_demo, , 2048, control_demo_main ) \ $(call _B, fixedwing_att_control, SCHED_PRIORITY_MAX-30, 2048, fixedwing_att_control_main ) \ $(call _B, fixedwing_pos_control, SCHED_PRIORITY_MAX-30, 2048, fixedwing_pos_control_main ) \ - $(call _B, kalman_demo, SCHED_PRIORITY_MAX-30, 2048, kalman_demo_main ) \ $(call _B, math_demo, , 8192, math_demo_main ) \ $(call _B, multirotor_att_control, SCHED_PRIORITY_MAX-15, 2048, multirotor_att_control_main) \ $(call _B, multirotor_pos_control, SCHED_PRIORITY_MAX-25, 2048, multirotor_pos_control_main) \ diff --git a/apps/examples/kalman_demo/KalmanNav.cpp b/src/modules/att_pos_estimator_ekf/KalmanNav.cpp similarity index 100% rename from apps/examples/kalman_demo/KalmanNav.cpp rename to src/modules/att_pos_estimator_ekf/KalmanNav.cpp diff --git a/apps/examples/kalman_demo/KalmanNav.hpp b/src/modules/att_pos_estimator_ekf/KalmanNav.hpp similarity index 100% rename from apps/examples/kalman_demo/KalmanNav.hpp rename to src/modules/att_pos_estimator_ekf/KalmanNav.hpp diff --git a/apps/examples/kalman_demo/kalman_demo.cpp b/src/modules/att_pos_estimator_ekf/kalman_main.cpp similarity index 96% rename from apps/examples/kalman_demo/kalman_demo.cpp rename to src/modules/att_pos_estimator_ekf/kalman_main.cpp index 581b68b016..aebe3d1feb 100644 --- a/apps/examples/kalman_demo/kalman_demo.cpp +++ b/src/modules/att_pos_estimator_ekf/kalman_main.cpp @@ -55,7 +55,7 @@ static int deamon_task; /**< Handle of deamon task / thread */ /** * Deamon management function. */ -extern "C" __EXPORT int kalman_demo_main(int argc, char *argv[]); +extern "C" __EXPORT int att_pos_estimator_ekf_main(int argc, char *argv[]); /** * Mainloop of deamon. @@ -85,7 +85,7 @@ usage(const char *reason) * The actual stack size should be set in the call * to task_create(). */ -int kalman_demo_main(int argc, char *argv[]) +int att_pos_estimator_ekf_main(int argc, char *argv[]) { if (argc < 1) diff --git a/apps/examples/kalman_demo/Makefile b/src/modules/att_pos_estimator_ekf/module.mk similarity index 89% rename from apps/examples/kalman_demo/Makefile rename to src/modules/att_pos_estimator_ekf/module.mk index 99c34d934e..abc6640182 100644 --- a/apps/examples/kalman_demo/Makefile +++ b/src/modules/att_pos_estimator_ekf/module.mk @@ -35,8 +35,11 @@ # Basic example application # -APPNAME = kalman_demo -PRIORITY = SCHED_PRIORITY_MAX - 30 -STACKSIZE = 2048 +MODULE_COMMAND = att_pos_estimator_ekf -include $(APPDIR)/mk/app.mk +# XXX this might be intended for the spawned deamon, validate +MODULE_PRIORITY = "SCHED_PRIORITY_MAX-30" + +SRCS = kalman_main.cpp \ + KalmanNav.cpp \ + params.c diff --git a/apps/examples/kalman_demo/params.c b/src/modules/att_pos_estimator_ekf/params.c similarity index 100% rename from apps/examples/kalman_demo/params.c rename to src/modules/att_pos_estimator_ekf/params.c From 988bf1eb0a3d36532883734a416f9c9e1e6ba125 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 14:28:47 +0200 Subject: [PATCH 5/6] Moved all fixed wing controllers to new world --- makefiles/config_px4fmu_default.mk | 7 +++++++ .../fixedwing_att_control_att.c | 3 +-- .../fixedwing_att_control_att.h | 0 .../fixedwing_att_control_main.c | 5 +++-- .../fixedwing_att_control_rate.c | 6 ++++-- .../fixedwing_att_control_rate.h | 0 .../modules/fixedwing_att_control/module.mk | 15 ++++++--------- .../fixedwing_backside_main.cpp | 14 ++++++++------ .../modules/fixedwing_backside/module.mk | 10 ++++------ .../modules/fixedwing_backside}/params.c | 0 .../fixedwing_pos_control_main.c | 0 .../modules/fixedwing_pos_control/module.mk | 13 ++++--------- 12 files changed, 37 insertions(+), 36 deletions(-) rename {apps => src/modules}/fixedwing_att_control/fixedwing_att_control_att.c (99%) rename {apps => src/modules}/fixedwing_att_control/fixedwing_att_control_att.h (100%) rename {apps => src/modules}/fixedwing_att_control/fixedwing_att_control_main.c (99%) rename {apps => src/modules}/fixedwing_att_control/fixedwing_att_control_rate.c (99%) rename {apps => src/modules}/fixedwing_att_control/fixedwing_att_control_rate.h (100%) rename apps/fixedwing_pos_control/Makefile => src/modules/fixedwing_att_control/module.mk (86%) rename apps/examples/control_demo/control_demo.cpp => src/modules/fixedwing_backside/fixedwing_backside_main.cpp (92%) rename apps/examples/control_demo/Makefile => src/modules/fixedwing_backside/module.mk (89%) rename {apps/examples/control_demo => src/modules/fixedwing_backside}/params.c (100%) rename {apps => src/modules}/fixedwing_pos_control/fixedwing_pos_control_main.c (100%) rename apps/fixedwing_att_control/Makefile => src/modules/fixedwing_pos_control/module.mk (86%) diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index 0767f71447..6fd7da4614 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -56,6 +56,13 @@ MODULES += modules/attitude_estimator_ekf MODULES += modules/position_estimator_mc MODULES += modules/att_pos_estimator_ekf +# +# Vehicle Control +# +MODULES += modules/fixedwing_backside +MODULES += modules/fixedwing_att_control +MODULES += modules/fixedwing_pos_control + # # Logging # diff --git a/apps/fixedwing_att_control/fixedwing_att_control_att.c b/src/modules/fixedwing_att_control/fixedwing_att_control_att.c similarity index 99% rename from apps/fixedwing_att_control/fixedwing_att_control_att.c rename to src/modules/fixedwing_att_control/fixedwing_att_control_att.c index b012448a23..769b8b0a8d 100644 --- a/apps/fixedwing_att_control/fixedwing_att_control_att.c +++ b/src/modules/fixedwing_att_control/fixedwing_att_control_att.c @@ -35,7 +35,6 @@ * @file fixedwing_att_control_rate.c * Implementation of a fixed wing attitude controller. */ -#include #include #include @@ -59,7 +58,7 @@ #include #include - +#include "fixedwing_att_control_att.h" struct fw_att_control_params { diff --git a/apps/fixedwing_att_control/fixedwing_att_control_att.h b/src/modules/fixedwing_att_control/fixedwing_att_control_att.h similarity index 100% rename from apps/fixedwing_att_control/fixedwing_att_control_att.h rename to src/modules/fixedwing_att_control/fixedwing_att_control_att.h diff --git a/apps/fixedwing_att_control/fixedwing_att_control_main.c b/src/modules/fixedwing_att_control/fixedwing_att_control_main.c similarity index 99% rename from apps/fixedwing_att_control/fixedwing_att_control_main.c rename to src/modules/fixedwing_att_control/fixedwing_att_control_main.c index aa9db6d528..58477632b2 100644 --- a/apps/fixedwing_att_control/fixedwing_att_control_main.c +++ b/src/modules/fixedwing_att_control/fixedwing_att_control_main.c @@ -65,8 +65,9 @@ #include #include #include -#include -#include + +#include "fixedwing_att_control_rate.h" +#include "fixedwing_att_control_att.h" /* Prototypes */ /** diff --git a/apps/fixedwing_att_control/fixedwing_att_control_rate.c b/src/modules/fixedwing_att_control/fixedwing_att_control_rate.c similarity index 99% rename from apps/fixedwing_att_control/fixedwing_att_control_rate.c rename to src/modules/fixedwing_att_control/fixedwing_att_control_rate.c index ba5b593e28..4eccc118cb 100644 --- a/apps/fixedwing_att_control/fixedwing_att_control_rate.c +++ b/src/modules/fixedwing_att_control/fixedwing_att_control_rate.c @@ -33,11 +33,11 @@ ****************************************************************************/ /** * @file fixedwing_att_control_rate.c + * @author Thomas Gubler + * * Implementation of a fixed wing attitude controller. * - * @author Thomas Gubler */ -#include #include #include @@ -61,6 +61,8 @@ #include #include +#include "fixedwing_att_control_rate.h" + /* * Controller parameters, accessible via MAVLink * diff --git a/apps/fixedwing_att_control/fixedwing_att_control_rate.h b/src/modules/fixedwing_att_control/fixedwing_att_control_rate.h similarity index 100% rename from apps/fixedwing_att_control/fixedwing_att_control_rate.h rename to src/modules/fixedwing_att_control/fixedwing_att_control_rate.h diff --git a/apps/fixedwing_pos_control/Makefile b/src/modules/fixedwing_att_control/module.mk similarity index 86% rename from apps/fixedwing_pos_control/Makefile rename to src/modules/fixedwing_att_control/module.mk index bce391f499..fd1a8724a5 100644 --- a/apps/fixedwing_pos_control/Makefile +++ b/src/modules/fixedwing_att_control/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -32,14 +32,11 @@ ############################################################################ # -# Fixedwing Control application +# Fixedwing Attitude Control application # -APPNAME = fixedwing_pos_control -PRIORITY = SCHED_PRIORITY_MAX - 30 -STACKSIZE = 2048 - -INCLUDES = $(TOPDIR)/../mavlink/include/mavlink - -include $(APPDIR)/mk/app.mk +MODULE_COMMAND = fixedwing_att_control +SRCS = fixedwing_att_control_main.c \ + fixedwing_att_control_att.c \ + fixedwing_att_control_rate.c diff --git a/apps/examples/control_demo/control_demo.cpp b/src/modules/fixedwing_backside/fixedwing_backside_main.cpp similarity index 92% rename from apps/examples/control_demo/control_demo.cpp rename to src/modules/fixedwing_backside/fixedwing_backside_main.cpp index e609f2f4bd..e21990c929 100644 --- a/apps/examples/control_demo/control_demo.cpp +++ b/src/modules/fixedwing_backside/fixedwing_backside_main.cpp @@ -1,7 +1,7 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. - * Author: @author Example User + * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. + * Author: James Goppert * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,10 @@ ****************************************************************************/ /** - * @file control_demo.cpp - * Demonstration of control library + * @file fixedwing_backside_main.cpp + * @author James Goppert + * + * Fixedwing backside controller using control library */ #include @@ -55,7 +57,7 @@ static int deamon_task; /**< Handle of deamon task / thread */ /** * Deamon management function. */ -extern "C" __EXPORT int control_demo_main(int argc, char *argv[]); +extern "C" __EXPORT int fixedwing_backside_main(int argc, char *argv[]); /** * Mainloop of deamon. @@ -90,7 +92,7 @@ usage(const char *reason) * The actual stack size should be set in the call * to task_create(). */ -int control_demo_main(int argc, char *argv[]) +int fixedwing_backside_main(int argc, char *argv[]) { if (argc < 1) diff --git a/apps/examples/control_demo/Makefile b/src/modules/fixedwing_backside/module.mk similarity index 89% rename from apps/examples/control_demo/Makefile rename to src/modules/fixedwing_backside/module.mk index 6e40e645f8..a9233288b0 100644 --- a/apps/examples/control_demo/Makefile +++ b/src/modules/fixedwing_backside/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -32,11 +32,9 @@ ############################################################################ # -# Basic example application +# Fixedwing backside controller # -APPNAME = control_demo -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = fixedwing_backside -include $(APPDIR)/mk/app.mk +SRCS = fixedwing_backside_main.cpp diff --git a/apps/examples/control_demo/params.c b/src/modules/fixedwing_backside/params.c similarity index 100% rename from apps/examples/control_demo/params.c rename to src/modules/fixedwing_backside/params.c diff --git a/apps/fixedwing_pos_control/fixedwing_pos_control_main.c b/src/modules/fixedwing_pos_control/fixedwing_pos_control_main.c similarity index 100% rename from apps/fixedwing_pos_control/fixedwing_pos_control_main.c rename to src/modules/fixedwing_pos_control/fixedwing_pos_control_main.c diff --git a/apps/fixedwing_att_control/Makefile b/src/modules/fixedwing_pos_control/module.mk similarity index 86% rename from apps/fixedwing_att_control/Makefile rename to src/modules/fixedwing_pos_control/module.mk index 01465fa9ec..b976377e93 100644 --- a/apps/fixedwing_att_control/Makefile +++ b/src/modules/fixedwing_pos_control/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -32,14 +32,9 @@ ############################################################################ # -# Fixedwing Control application +# Fixedwing PositionControl application # -APPNAME = fixedwing_att_control -PRIORITY = SCHED_PRIORITY_MAX - 30 -STACKSIZE = 2048 - -INCLUDES = $(TOPDIR)/../mavlink/include/mavlink - -include $(APPDIR)/mk/app.mk +MODULE_COMMAND = fixedwing_pos_control +SRCS = fixedwing_pos_control_main.c From 7ca82801bd4d4b9d6f4a0ac515e5cfcdc28f2e05 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 14:42:12 +0200 Subject: [PATCH 6/6] Moved multirotor controllers --- makefiles/config_px4fmu_default.mk | 8 +++----- .../modules/multirotor_att_control/module.mk | 12 ++++++------ .../multirotor_att_control_main.c | 0 .../multirotor_attitude_control.c | 0 .../multirotor_attitude_control.h | 0 .../multirotor_att_control/multirotor_rate_control.c | 0 .../multirotor_att_control/multirotor_rate_control.h | 0 .../modules/multirotor_pos_control/module.mk | 11 +++++------ .../multirotor_pos_control/multirotor_pos_control.c | 0 .../multirotor_pos_control_params.c | 0 .../multirotor_pos_control_params.h | 0 .../multirotor_pos_control/position_control.c | 0 .../multirotor_pos_control/position_control.h | 0 {apps => src/modules}/position_estimator/.context | 0 .../modules/position_estimator/module.mk | 12 ++++++------ .../position_estimator/position_estimator_main.c | 0 16 files changed, 20 insertions(+), 23 deletions(-) rename apps/multirotor_pos_control/Makefile => src/modules/multirotor_att_control/module.mk (85%) mode change 100644 => 100755 rename {apps => src/modules}/multirotor_att_control/multirotor_att_control_main.c (100%) rename {apps => src/modules}/multirotor_att_control/multirotor_attitude_control.c (100%) rename {apps => src/modules}/multirotor_att_control/multirotor_attitude_control.h (100%) rename {apps => src/modules}/multirotor_att_control/multirotor_rate_control.c (100%) rename {apps => src/modules}/multirotor_att_control/multirotor_rate_control.h (100%) rename apps/multirotor_att_control/Makefile => src/modules/multirotor_pos_control/module.mk (88%) mode change 100755 => 100644 rename {apps => src/modules}/multirotor_pos_control/multirotor_pos_control.c (100%) rename {apps => src/modules}/multirotor_pos_control/multirotor_pos_control_params.c (100%) rename {apps => src/modules}/multirotor_pos_control/multirotor_pos_control_params.h (100%) rename {apps => src/modules}/multirotor_pos_control/position_control.c (100%) rename {apps => src/modules}/multirotor_pos_control/position_control.h (100%) rename {apps => src/modules}/position_estimator/.context (100%) rename apps/position_estimator/Makefile => src/modules/position_estimator/module.mk (85%) rename {apps => src/modules}/position_estimator/position_estimator_main.c (100%) diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index 6fd7da4614..fea9a814d2 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -54,6 +54,7 @@ MODULES += modules/mavlink_onboard # MODULES += modules/attitude_estimator_ekf MODULES += modules/position_estimator_mc +MODULES += modules/position_estimator MODULES += modules/att_pos_estimator_ekf # @@ -62,6 +63,8 @@ MODULES += modules/att_pos_estimator_ekf MODULES += modules/fixedwing_backside MODULES += modules/fixedwing_att_control MODULES += modules/fixedwing_pos_control +MODULES += modules/multirotor_att_control +MODULES += modules/multirotor_pos_control # # Logging @@ -83,12 +86,7 @@ endef # command priority stack entrypoint BUILTIN_COMMANDS := \ $(call _B, adc, , 2048, adc_main ) \ - $(call _B, control_demo, , 2048, control_demo_main ) \ - $(call _B, fixedwing_att_control, SCHED_PRIORITY_MAX-30, 2048, fixedwing_att_control_main ) \ - $(call _B, fixedwing_pos_control, SCHED_PRIORITY_MAX-30, 2048, fixedwing_pos_control_main ) \ $(call _B, math_demo, , 8192, math_demo_main ) \ - $(call _B, multirotor_att_control, SCHED_PRIORITY_MAX-15, 2048, multirotor_att_control_main) \ - $(call _B, multirotor_pos_control, SCHED_PRIORITY_MAX-25, 2048, multirotor_pos_control_main) \ $(call _B, sercon, , 2048, sercon_main ) \ $(call _B, serdis, , 2048, serdis_main ) \ $(call _B, tone_alarm, , 2048, tone_alarm_main ) \ diff --git a/apps/multirotor_pos_control/Makefile b/src/modules/multirotor_att_control/module.mk old mode 100644 new mode 100755 similarity index 85% rename from apps/multirotor_pos_control/Makefile rename to src/modules/multirotor_att_control/module.mk index c88c854356..2fd52c162e --- a/apps/multirotor_pos_control/Makefile +++ b/src/modules/multirotor_att_control/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -32,11 +32,11 @@ ############################################################################ # -# Makefile to build multirotor position control +# Makefile to build the multirotor attitude controller # -APPNAME = multirotor_pos_control -PRIORITY = SCHED_PRIORITY_MAX - 25 -STACKSIZE = 2048 +MODULE_COMMAND = multirotor_att_control -include $(APPDIR)/mk/app.mk +SRCS = multirotor_att_control_main.c \ + multirotor_attitude_control.c \ + multirotor_rate_control.c diff --git a/apps/multirotor_att_control/multirotor_att_control_main.c b/src/modules/multirotor_att_control/multirotor_att_control_main.c similarity index 100% rename from apps/multirotor_att_control/multirotor_att_control_main.c rename to src/modules/multirotor_att_control/multirotor_att_control_main.c diff --git a/apps/multirotor_att_control/multirotor_attitude_control.c b/src/modules/multirotor_att_control/multirotor_attitude_control.c similarity index 100% rename from apps/multirotor_att_control/multirotor_attitude_control.c rename to src/modules/multirotor_att_control/multirotor_attitude_control.c diff --git a/apps/multirotor_att_control/multirotor_attitude_control.h b/src/modules/multirotor_att_control/multirotor_attitude_control.h similarity index 100% rename from apps/multirotor_att_control/multirotor_attitude_control.h rename to src/modules/multirotor_att_control/multirotor_attitude_control.h diff --git a/apps/multirotor_att_control/multirotor_rate_control.c b/src/modules/multirotor_att_control/multirotor_rate_control.c similarity index 100% rename from apps/multirotor_att_control/multirotor_rate_control.c rename to src/modules/multirotor_att_control/multirotor_rate_control.c diff --git a/apps/multirotor_att_control/multirotor_rate_control.h b/src/modules/multirotor_att_control/multirotor_rate_control.h similarity index 100% rename from apps/multirotor_att_control/multirotor_rate_control.h rename to src/modules/multirotor_att_control/multirotor_rate_control.h diff --git a/apps/multirotor_att_control/Makefile b/src/modules/multirotor_pos_control/module.mk old mode 100755 new mode 100644 similarity index 88% rename from apps/multirotor_att_control/Makefile rename to src/modules/multirotor_pos_control/module.mk index 03cf33e434..d048477455 --- a/apps/multirotor_att_control/Makefile +++ b/src/modules/multirotor_pos_control/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -32,11 +32,10 @@ ############################################################################ # -# Makefile to build uORB +# Build multirotor position control # -APPNAME = multirotor_att_control -PRIORITY = SCHED_PRIORITY_MAX - 15 -STACKSIZE = 2048 +MODULE_COMMAND = multirotor_pos_control -include $(APPDIR)/mk/app.mk +SRCS = multirotor_pos_control.c \ + multirotor_pos_control_params.c diff --git a/apps/multirotor_pos_control/multirotor_pos_control.c b/src/modules/multirotor_pos_control/multirotor_pos_control.c similarity index 100% rename from apps/multirotor_pos_control/multirotor_pos_control.c rename to src/modules/multirotor_pos_control/multirotor_pos_control.c diff --git a/apps/multirotor_pos_control/multirotor_pos_control_params.c b/src/modules/multirotor_pos_control/multirotor_pos_control_params.c similarity index 100% rename from apps/multirotor_pos_control/multirotor_pos_control_params.c rename to src/modules/multirotor_pos_control/multirotor_pos_control_params.c diff --git a/apps/multirotor_pos_control/multirotor_pos_control_params.h b/src/modules/multirotor_pos_control/multirotor_pos_control_params.h similarity index 100% rename from apps/multirotor_pos_control/multirotor_pos_control_params.h rename to src/modules/multirotor_pos_control/multirotor_pos_control_params.h diff --git a/apps/multirotor_pos_control/position_control.c b/src/modules/multirotor_pos_control/position_control.c similarity index 100% rename from apps/multirotor_pos_control/position_control.c rename to src/modules/multirotor_pos_control/position_control.c diff --git a/apps/multirotor_pos_control/position_control.h b/src/modules/multirotor_pos_control/position_control.h similarity index 100% rename from apps/multirotor_pos_control/position_control.h rename to src/modules/multirotor_pos_control/position_control.h diff --git a/apps/position_estimator/.context b/src/modules/position_estimator/.context similarity index 100% rename from apps/position_estimator/.context rename to src/modules/position_estimator/.context diff --git a/apps/position_estimator/Makefile b/src/modules/position_estimator/module.mk similarity index 85% rename from apps/position_estimator/Makefile rename to src/modules/position_estimator/module.mk index cc5072152c..f64095d9d1 100644 --- a/apps/position_estimator/Makefile +++ b/src/modules/position_estimator/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012 PX4 Development Team. All rights reserved. +# Copyright (c) 2012, 2013 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 @@ -35,10 +35,10 @@ # Makefile to build the position estimator # -APPNAME = position_estimator -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +MODULE_COMMAND = position_estimator -CSRCS = position_estimator_main.c +# XXX this should be converted to a deamon, its a pretty bad example app +MODULE_PRIORITY = SCHED_PRIORITY_DEFAULT +MODULE_STACKSIZE = 4096 -include $(APPDIR)/mk/app.mk +SRCS = position_estimator_main.c diff --git a/apps/position_estimator/position_estimator_main.c b/src/modules/position_estimator/position_estimator_main.c similarity index 100% rename from apps/position_estimator/position_estimator_main.c rename to src/modules/position_estimator/position_estimator_main.c