From d8a3454538e2a634513defd50b40fb49c194b670 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 00:10:20 +0200 Subject: [PATCH 1/7] Cut over MAVLink to new build system --- apps/mavlink/.context | 0 makefiles/config_px4fmu_default.mk | 4 ++-- {apps => src/include}/mavlink/mavlink_log.h | 0 {apps => src/modules}/mavlink/.gitignore | 0 {apps => src/modules}/mavlink/mavlink.c | 2 +- .../modules}/mavlink/mavlink_bridge_header.h | 2 +- {apps => src/modules}/mavlink/mavlink_hil.h | 0 {apps => src/modules}/mavlink/mavlink_log.c | 2 +- .../modules}/mavlink/mavlink_parameters.c | 0 .../modules}/mavlink/mavlink_parameters.h | 0 .../modules}/mavlink/mavlink_receiver.c | 4 ++-- {apps => src/modules}/mavlink/missionlib.c | 2 +- {apps => src/modules}/mavlink/missionlib.h | 0 .../Makefile => src/modules/mavlink/module.mk | 19 +++++++++++-------- {apps => src/modules}/mavlink/orb_listener.c | 3 ++- {apps => src/modules}/mavlink/orb_topics.h | 0 {apps => src/modules}/mavlink/util.h | 0 {apps => src/modules}/mavlink/waypoints.c | 0 {apps => src/modules}/mavlink/waypoints.h | 0 .../modules}/mavlink_onboard/mavlink.c | 0 .../mavlink_onboard/mavlink_bridge_header.h | 2 +- .../mavlink_onboard/mavlink_receiver.c | 0 .../modules/mavlink_onboard/module.mk | 14 ++++++-------- .../modules}/mavlink_onboard/orb_topics.h | 0 {apps => src/modules}/mavlink_onboard/util.h | 0 25 files changed, 28 insertions(+), 26 deletions(-) delete mode 100644 apps/mavlink/.context rename {apps => src/include}/mavlink/mavlink_log.h (100%) rename {apps => src/modules}/mavlink/.gitignore (100%) rename {apps => src/modules}/mavlink/mavlink.c (99%) rename {apps => src/modules}/mavlink/mavlink_bridge_header.h (98%) rename {apps => src/modules}/mavlink/mavlink_hil.h (100%) rename {apps => src/modules}/mavlink/mavlink_log.c (98%) rename {apps => src/modules}/mavlink/mavlink_parameters.c (100%) rename {apps => src/modules}/mavlink/mavlink_parameters.h (100%) rename {apps => src/modules}/mavlink/mavlink_receiver.c (99%) rename {apps => src/modules}/mavlink/missionlib.c (99%) rename {apps => src/modules}/mavlink/missionlib.h (100%) rename apps/mavlink_onboard/Makefile => src/modules/mavlink/module.mk (82%) rename {apps => src/modules}/mavlink/orb_listener.c (99%) rename {apps => src/modules}/mavlink/orb_topics.h (100%) rename {apps => src/modules}/mavlink/util.h (100%) rename {apps => src/modules}/mavlink/waypoints.c (100%) rename {apps => src/modules}/mavlink/waypoints.h (100%) rename {apps => src/modules}/mavlink_onboard/mavlink.c (100%) rename {apps => src/modules}/mavlink_onboard/mavlink_bridge_header.h (98%) rename {apps => src/modules}/mavlink_onboard/mavlink_receiver.c (100%) rename apps/mavlink/Makefile => src/modules/mavlink_onboard/module.mk (85%) rename {apps => src/modules}/mavlink_onboard/orb_topics.h (100%) rename {apps => src/modules}/mavlink_onboard/util.h (100%) diff --git a/apps/mavlink/.context b/apps/mavlink/.context deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index e70079fa1f..44e35bdf9b 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -25,6 +25,8 @@ MODULES += systemcmds/tests # General system control # MODULES += modules/commander +MODULES += modules/mavlink +MODULES += modules/mavlink_onboard # # Estimation modules (EKF / other filters) @@ -60,8 +62,6 @@ BUILTIN_COMMANDS := \ $(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, mavlink, , 2048, mavlink_main ) \ - $(call _B, mavlink_onboard, , 2048, mavlink_onboard_main ) \ $(call _B, mixer, , 4096, mixer_main ) \ $(call _B, mpu6000, , 4096, mpu6000_main ) \ $(call _B, ms5611, , 2048, ms5611_main ) \ diff --git a/apps/mavlink/mavlink_log.h b/src/include/mavlink/mavlink_log.h similarity index 100% rename from apps/mavlink/mavlink_log.h rename to src/include/mavlink/mavlink_log.h diff --git a/apps/mavlink/.gitignore b/src/modules/mavlink/.gitignore similarity index 100% rename from apps/mavlink/.gitignore rename to src/modules/mavlink/.gitignore diff --git a/apps/mavlink/mavlink.c b/src/modules/mavlink/mavlink.c similarity index 99% rename from apps/mavlink/mavlink.c rename to src/modules/mavlink/mavlink.c index 644b779af2..de78cd1399 100644 --- a/apps/mavlink/mavlink.c +++ b/src/modules/mavlink/mavlink.c @@ -64,9 +64,9 @@ #include #include #include +#include #include "waypoints.h" -#include "mavlink_log.h" #include "orb_topics.h" #include "missionlib.h" #include "mavlink_hil.h" diff --git a/apps/mavlink/mavlink_bridge_header.h b/src/modules/mavlink/mavlink_bridge_header.h similarity index 98% rename from apps/mavlink/mavlink_bridge_header.h rename to src/modules/mavlink/mavlink_bridge_header.h index 270ec17274..0010bb341e 100644 --- a/apps/mavlink/mavlink_bridge_header.h +++ b/src/modules/mavlink/mavlink_bridge_header.h @@ -51,7 +51,7 @@ #define MAVLINK_GET_CHANNEL_BUFFER mavlink_get_channel_buffer #define MAVLINK_GET_CHANNEL_STATUS mavlink_get_channel_status -#include "v1.0/mavlink_types.h" +#include #include diff --git a/apps/mavlink/mavlink_hil.h b/src/modules/mavlink/mavlink_hil.h similarity index 100% rename from apps/mavlink/mavlink_hil.h rename to src/modules/mavlink/mavlink_hil.h diff --git a/apps/mavlink/mavlink_log.c b/src/modules/mavlink/mavlink_log.c similarity index 98% rename from apps/mavlink/mavlink_log.c rename to src/modules/mavlink/mavlink_log.c index ed65fb883c..fa974dc0b6 100644 --- a/apps/mavlink/mavlink_log.c +++ b/src/modules/mavlink/mavlink_log.c @@ -42,7 +42,7 @@ #include #include -#include "mavlink_log.h" +#include void mavlink_logbuffer_init(struct mavlink_logbuffer *lb, int size) { diff --git a/apps/mavlink/mavlink_parameters.c b/src/modules/mavlink/mavlink_parameters.c similarity index 100% rename from apps/mavlink/mavlink_parameters.c rename to src/modules/mavlink/mavlink_parameters.c diff --git a/apps/mavlink/mavlink_parameters.h b/src/modules/mavlink/mavlink_parameters.h similarity index 100% rename from apps/mavlink/mavlink_parameters.h rename to src/modules/mavlink/mavlink_parameters.h diff --git a/apps/mavlink/mavlink_receiver.c b/src/modules/mavlink/mavlink_receiver.c similarity index 99% rename from apps/mavlink/mavlink_receiver.c rename to src/modules/mavlink/mavlink_receiver.c index 22c2fcdade..e62e4dcc4c 100644 --- a/apps/mavlink/mavlink_receiver.c +++ b/src/modules/mavlink/mavlink_receiver.c @@ -64,9 +64,9 @@ #include #include +#include #include "waypoints.h" -#include "mavlink_log.h" #include "orb_topics.h" #include "missionlib.h" #include "mavlink_hil.h" @@ -312,7 +312,7 @@ handle_message(mavlink_message_t *msg) static const float ground_press = 1013.25f; // mbar static const float ground_tempC = 21.0f; static const float ground_alt = 0.0f; - static const float T0 = 273.15; + static const float T0 = 273.15f; static const float R = 287.05f; static const float g = 9.806f; diff --git a/apps/mavlink/missionlib.c b/src/modules/mavlink/missionlib.c similarity index 99% rename from apps/mavlink/missionlib.c rename to src/modules/mavlink/missionlib.c index 8064febc47..d369e05ffa 100644 --- a/apps/mavlink/missionlib.c +++ b/src/modules/mavlink/missionlib.c @@ -62,9 +62,9 @@ #include #include +#include #include "waypoints.h" -#include "mavlink_log.h" #include "orb_topics.h" #include "missionlib.h" #include "mavlink_hil.h" diff --git a/apps/mavlink/missionlib.h b/src/modules/mavlink/missionlib.h similarity index 100% rename from apps/mavlink/missionlib.h rename to src/modules/mavlink/missionlib.h diff --git a/apps/mavlink_onboard/Makefile b/src/modules/mavlink/module.mk similarity index 82% rename from apps/mavlink_onboard/Makefile rename to src/modules/mavlink/module.mk index 8b1cb9b2c7..cbf08aeb20 100644 --- a/apps/mavlink_onboard/Makefile +++ b/src/modules/mavlink/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,13 +32,16 @@ ############################################################################ # -# Mavlink Application +# MAVLink protocol to uORB interface process # -APPNAME = mavlink_onboard -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = mavlink +SRCS += mavlink.c \ + missionlib.c \ + mavlink_parameters.c \ + mavlink_log.c \ + mavlink_receiver.c \ + orb_listener.c \ + waypoints.c -INCLUDES = $(TOPDIR)/../mavlink/include/mavlink - -include $(APPDIR)/mk/app.mk +INCLUDE_DIRS += $(MAVLINK_SRC)/include/mavlink diff --git a/apps/mavlink/orb_listener.c b/src/modules/mavlink/orb_listener.c similarity index 99% rename from apps/mavlink/orb_listener.c rename to src/modules/mavlink/orb_listener.c index 5f15facf87..295cd5e28c 100644 --- a/apps/mavlink/orb_listener.c +++ b/src/modules/mavlink/orb_listener.c @@ -56,8 +56,9 @@ #include #include +#include + #include "waypoints.h" -#include "mavlink_log.h" #include "orb_topics.h" #include "missionlib.h" #include "mavlink_hil.h" diff --git a/apps/mavlink/orb_topics.h b/src/modules/mavlink/orb_topics.h similarity index 100% rename from apps/mavlink/orb_topics.h rename to src/modules/mavlink/orb_topics.h diff --git a/apps/mavlink/util.h b/src/modules/mavlink/util.h similarity index 100% rename from apps/mavlink/util.h rename to src/modules/mavlink/util.h diff --git a/apps/mavlink/waypoints.c b/src/modules/mavlink/waypoints.c similarity index 100% rename from apps/mavlink/waypoints.c rename to src/modules/mavlink/waypoints.c diff --git a/apps/mavlink/waypoints.h b/src/modules/mavlink/waypoints.h similarity index 100% rename from apps/mavlink/waypoints.h rename to src/modules/mavlink/waypoints.h diff --git a/apps/mavlink_onboard/mavlink.c b/src/modules/mavlink_onboard/mavlink.c similarity index 100% rename from apps/mavlink_onboard/mavlink.c rename to src/modules/mavlink_onboard/mavlink.c diff --git a/apps/mavlink_onboard/mavlink_bridge_header.h b/src/modules/mavlink_onboard/mavlink_bridge_header.h similarity index 98% rename from apps/mavlink_onboard/mavlink_bridge_header.h rename to src/modules/mavlink_onboard/mavlink_bridge_header.h index bf7c5354cc..3ad3bb6175 100644 --- a/apps/mavlink_onboard/mavlink_bridge_header.h +++ b/src/modules/mavlink_onboard/mavlink_bridge_header.h @@ -51,7 +51,7 @@ #define MAVLINK_GET_CHANNEL_BUFFER mavlink_get_channel_buffer #define MAVLINK_GET_CHANNEL_STATUS mavlink_get_channel_status -#include "v1.0/mavlink_types.h" +#include #include diff --git a/apps/mavlink_onboard/mavlink_receiver.c b/src/modules/mavlink_onboard/mavlink_receiver.c similarity index 100% rename from apps/mavlink_onboard/mavlink_receiver.c rename to src/modules/mavlink_onboard/mavlink_receiver.c diff --git a/apps/mavlink/Makefile b/src/modules/mavlink_onboard/module.mk similarity index 85% rename from apps/mavlink/Makefile rename to src/modules/mavlink_onboard/module.mk index 8ddb69b71d..c40fa042e8 100644 --- a/apps/mavlink/Makefile +++ b/src/modules/mavlink_onboard/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,13 +32,11 @@ ############################################################################ # -# Mavlink Application +# MAVLink protocol to uORB interface process (XXX hack for onboard use) # -APPNAME = mavlink -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = mavlink_onboard +SRCS = mavlink.c \ + mavlink_receiver.c -INCLUDES = $(TOPDIR)/../mavlink/include/mavlink - -include $(APPDIR)/mk/app.mk +INCLUDE_DIRS += $(MAVLINK_SRC)/include/mavlink diff --git a/apps/mavlink_onboard/orb_topics.h b/src/modules/mavlink_onboard/orb_topics.h similarity index 100% rename from apps/mavlink_onboard/orb_topics.h rename to src/modules/mavlink_onboard/orb_topics.h diff --git a/apps/mavlink_onboard/util.h b/src/modules/mavlink_onboard/util.h similarity index 100% rename from apps/mavlink_onboard/util.h rename to src/modules/mavlink_onboard/util.h From f924e312fa8022c6f4ee61cd8c0d6693ccb8a743 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 00:11:16 +0200 Subject: [PATCH 2/7] Merged --- src/modules/attitude_estimator_ekf/module.mk | 62 ++++++++++++++++---- 1 file changed, 49 insertions(+), 13 deletions(-) diff --git a/src/modules/attitude_estimator_ekf/module.mk b/src/modules/attitude_estimator_ekf/module.mk index 5ce5451122..bfb7db9977 100644 --- a/src/modules/attitude_estimator_ekf/module.mk +++ b/src/modules/attitude_estimator_ekf/module.mk @@ -1,16 +1,52 @@ +############################################################################ +# +# 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. +# +############################################################################ + +# +# Attitude estimator (Extended Kalman Filter) +# MODULE_NAME = attitude_estimator_ekf -SRCS = attitude_estimator_ekf_main.cpp \ - 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 +CXXSRCS = attitude_estimator_ekf_main.cpp +SRCS = 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 From f57b9ab29863bb504dcab6d96a80c9c914c4af69 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 00:13:03 +0200 Subject: [PATCH 3/7] Deleted old-style EEPROM driver, new one is already functional From 51badab96ddd4273595cf49e494375d7f2235708 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 00:13:35 +0200 Subject: [PATCH 4/7] Deleted old cruft --- apps/systemcmds/delay_test/Makefile | 44 ------- apps/systemcmds/delay_test/delay_test.c | 160 ------------------------ 2 files changed, 204 deletions(-) delete mode 100644 apps/systemcmds/delay_test/Makefile delete mode 100644 apps/systemcmds/delay_test/delay_test.c diff --git a/apps/systemcmds/delay_test/Makefile b/apps/systemcmds/delay_test/Makefile deleted file mode 100644 index e54cf2f4e4..0000000000 --- a/apps/systemcmds/delay_test/Makefile +++ /dev/null @@ -1,44 +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. -# -############################################################################ - -# -# Delay test -# - -APPNAME = delay_test -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 - -include $(APPDIR)/mk/app.mk - -MAXOPTIMIZATION = -Os diff --git a/apps/systemcmds/delay_test/delay_test.c b/apps/systemcmds/delay_test/delay_test.c deleted file mode 100644 index 51cce38fca..0000000000 --- a/apps/systemcmds/delay_test/delay_test.c +++ /dev/null @@ -1,160 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. - * Author: Lorenz Meier - * - * 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. - * - ****************************************************************************/ - -/** - * @file delay_test.c - * - * Simple but effective delay test using leds and a scope to measure - * communication delays end-to-end accurately. - * - * @author Lorenz Meier - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include - -__EXPORT int delay_test_main(int argc, char *argv[]); -static int led_on(int leds, int led); -static int led_off(int leds, int led); - -int delay_test_main(int argc, char *argv[]) -{ - bool vicon_msg = false; - bool command_msg = false; - - if (argc > 1 && !strcmp(argv[1], "--help")) { - warnx("usage: delay_test [vicon] [command]\n"); - exit(1); - } - - if (argc > 1 && !strcmp(argv[1], "vicon")) { - vicon_msg = true; - } - - if (argc > 1 && !strcmp(argv[1], "command")) { - command_msg = true; - } - - int buzzer = open("/dev/tone_alarm", O_WRONLY); - int leds = open(LED_DEVICE_PATH, 0); - - /* prepare use of amber led */ - led_off(leds, LED_AMBER); - - int topic; - - /* subscribe to topic */ - if (vicon_msg) { - topic = orb_subscribe(ORB_ID(vehicle_vicon_position)); - } else if (command_msg) { - topic = orb_subscribe(ORB_ID(vehicle_command)); - } else { - errx(1, "No topic selected for delay test, use --help for a list of topics."); - } - - const int testcount = 20; - - warnx("running %d iterations..\n", testcount); - - struct pollfd fds[1]; - fds[0].fd = topic; - fds[0].events = POLLIN; - - /* display and sound error */ - for (int i = 0; i < testcount; i++) - { - /* wait for topic */ - int ret = poll(&fds[0], 1, 2000); - - /* this would be bad... */ - if (ret < 0) { - warnx("poll error %d", errno); - usleep(1000000); - continue; - } - - /* do we have a topic update? */ - if (fds[0].revents & POLLIN) { - - /* copy object to disable poll ready state */ - if (vicon_msg) { - struct vehicle_vicon_position_s vicon_position; - orb_copy(ORB_ID(vehicle_vicon_position), topic, &vicon_position); - } else if (command_msg) { - struct vehicle_command_s vehicle_command; - orb_copy(ORB_ID(vehicle_command), topic, &vehicle_command); - } - - led_on(leds, LED_AMBER); - ioctl(buzzer, TONE_SET_ALARM, 4); - /* keep led on for 50 ms to make it barely visible */ - usleep(50000); - led_off(leds, LED_AMBER); - } - } - - /* stop alarm */ - ioctl(buzzer, TONE_SET_ALARM, 0); - - /* switch on leds */ - led_on(leds, LED_BLUE); - led_on(leds, LED_AMBER); - - exit(0); -} - -static int led_off(int leds, int led) -{ - return ioctl(leds, LED_OFF, led); -} - -static int led_on(int leds, int led) -{ - return ioctl(leds, LED_ON, led); -} \ No newline at end of file From 574e76532126fea8ab0ac5fd0595f6fb2935f0dd Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 11:30:41 +0200 Subject: [PATCH 5/7] Moved all system commands to the new world --- apps/systemcmds/boardinfo/.context | 0 apps/systemcmds/calibration/Makefile | 44 --- apps/systemcmds/calibration/calibration.c | 147 ---------- apps/systemcmds/calibration/calibration.h | 60 ---- apps/systemcmds/calibration/channels_cal.c | 196 ------------- apps/systemcmds/calibration/range_cal.c | 224 --------------- apps/systemcmds/calibration/servo_cal.c | 264 ------------------ apps/systemcmds/perf/.context | 0 apps/systemcmds/reboot/.context | 0 apps/systemcmds/top/.context | 0 apps/systemcmds/top/Makefile | 44 --- makefiles/config_px4fmu_default.mk | 22 +- src/modules/mavlink_onboard/module.mk | 2 +- .../systemcmds/bl_update/bl_update.c | 2 +- .../systemcmds/bl_update/module.mk | 11 +- .../systemcmds/boardinfo/boardinfo.c | 2 +- .../systemcmds/boardinfo/module.mk | 11 +- src/systemcmds/eeprom/module.mk | 33 +++ {apps => src}/systemcmds/i2c/i2c.c | 2 +- .../Makefile => src/systemcmds/i2c/module.mk | 9 +- {apps => src}/systemcmds/mixer/mixer.c | 0 .../systemcmds/mixer/module.mk | 9 +- .../systemcmds/param/module.mk | 10 +- {apps => src}/systemcmds/param/param.c | 0 .../Makefile => src/systemcmds/perf/module.mk | 9 +- {apps => src}/systemcmds/perf/perf.c | 2 +- .../systemcmds/preflight_check/module.mk | 12 +- .../preflight_check/preflight_check.c | 2 +- .../Makefile => src/systemcmds/pwm/module.mk | 9 +- {apps => src}/systemcmds/pwm/pwm.c | 0 src/systemcmds/reboot/module.mk | 41 +++ {apps => src}/systemcmds/reboot/reboot.c | 0 .../Makefile => src/systemcmds/top/module.mk | 12 +- {apps => src}/systemcmds/top/top.c | 0 34 files changed, 131 insertions(+), 1048 deletions(-) delete mode 100644 apps/systemcmds/boardinfo/.context delete mode 100644 apps/systemcmds/calibration/Makefile delete mode 100755 apps/systemcmds/calibration/calibration.c delete mode 100644 apps/systemcmds/calibration/calibration.h delete mode 100755 apps/systemcmds/calibration/channels_cal.c delete mode 100755 apps/systemcmds/calibration/range_cal.c delete mode 100644 apps/systemcmds/calibration/servo_cal.c delete mode 100644 apps/systemcmds/perf/.context delete mode 100644 apps/systemcmds/reboot/.context delete mode 100644 apps/systemcmds/top/.context delete mode 100644 apps/systemcmds/top/Makefile rename {apps => src}/systemcmds/bl_update/bl_update.c (98%) rename apps/systemcmds/bl_update/Makefile => src/systemcmds/bl_update/module.mk (88%) rename {apps => src}/systemcmds/boardinfo/boardinfo.c (99%) rename apps/systemcmds/preflight_check/Makefile => src/systemcmds/boardinfo/module.mk (89%) rename {apps => src}/systemcmds/i2c/i2c.c (98%) rename apps/systemcmds/i2c/Makefile => src/systemcmds/i2c/module.mk (91%) rename {apps => src}/systemcmds/mixer/mixer.c (100%) rename apps/systemcmds/mixer/Makefile => src/systemcmds/mixer/module.mk (91%) rename apps/systemcmds/param/Makefile => src/systemcmds/param/module.mk (91%) rename {apps => src}/systemcmds/param/param.c (100%) rename apps/systemcmds/perf/Makefile => src/systemcmds/perf/module.mk (91%) rename {apps => src}/systemcmds/perf/perf.c (97%) rename apps/systemcmds/boardinfo/Makefile => src/systemcmds/preflight_check/module.mk (86%) rename {apps => src}/systemcmds/preflight_check/preflight_check.c (98%) rename apps/systemcmds/pwm/Makefile => src/systemcmds/pwm/module.mk (91%) rename {apps => src}/systemcmds/pwm/pwm.c (100%) create mode 100644 src/systemcmds/reboot/module.mk rename {apps => src}/systemcmds/reboot/reboot.c (100%) rename apps/systemcmds/reboot/Makefile => src/systemcmds/top/module.mk (90%) rename {apps => src}/systemcmds/top/top.c (100%) diff --git a/apps/systemcmds/boardinfo/.context b/apps/systemcmds/boardinfo/.context deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/systemcmds/calibration/Makefile b/apps/systemcmds/calibration/Makefile deleted file mode 100644 index a1735962e1..0000000000 --- a/apps/systemcmds/calibration/Makefile +++ /dev/null @@ -1,44 +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 calibration tool -# - -APPNAME = calibration -PRIORITY = SCHED_PRIORITY_MAX - 1 -STACKSIZE = 4096 - -include $(APPDIR)/mk/app.mk - -MAXOPTIMIZATION = -Os diff --git a/apps/systemcmds/calibration/calibration.c b/apps/systemcmds/calibration/calibration.c deleted file mode 100755 index 7f8b9240f4..0000000000 --- a/apps/systemcmds/calibration/calibration.c +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** - * calibration.c - * - * Copyright (C) 2012 Ivan Ovinnikov. All rights reserved. - * Authors: Nils Wenzler - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ -#include -#include -#include -#include "calibration.h" - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -static int calibrate_help(int argc, char *argv[]); -static int calibrate_all(int argc, char *argv[]); - -__EXPORT int calibration_main(int argc, char *argv[]); - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -struct { - const char *name; - int (* fn)(int argc, char *argv[]); - unsigned options; -#define OPT_NOHELP (1<<0) -#define OPT_NOALLTEST (1<<1) -} calibrates[] = { - {"range", range_cal, 0}, - {"servo", servo_cal, 0}, - {"all", calibrate_all, OPT_NOALLTEST}, - {"help", calibrate_help, OPT_NOALLTEST | OPT_NOHELP}, - {NULL, NULL} -}; - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -static int -calibrate_help(int argc, char *argv[]) -{ - unsigned i; - - printf("Available calibration routines:\n"); - - for (i = 0; calibrates[i].name; i++) - printf(" %s\n", calibrates[i].name); - - return 0; -} - -static int -calibrate_all(int argc, char *argv[]) -{ - unsigned i; - char *args[2] = {"all", NULL}; - - printf("Running all calibration routines...\n\n"); - - for (i = 0; calibrates[i].name; i++) { - printf(" %s:\n", calibrates[i].name); - - if (calibrates[i].fn(1, args)) { - printf(" FAIL\n"); - - } else { - printf(" DONE\n"); - } - } - - return 0; -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -void press_enter(void) -{ - int c; - printf("Press CTRL+ENTER to continue... \n"); - fflush(stdout); - - do c = getchar(); while ((c != '\n') && (c != EOF)); -} - -/**************************************************************************** - * Name: calibrate_main - ****************************************************************************/ - -int calibration_main(int argc, char *argv[]) -{ - unsigned i; - - if (argc < 2) { - printf("calibration: missing name - 'calibration help' for a list of routines\n"); - return 1; - } - - for (i = 0; calibrates[i].name; i++) { - if (!strcmp(calibrates[i].name, argv[1])) - return calibrates[i].fn(argc - 1, argv + 1); - } - - printf("calibrate: no routines called '%s' - 'calibration help' for a list of routines\n", argv[1]); - return 1; -} diff --git a/apps/systemcmds/calibration/calibration.h b/apps/systemcmds/calibration/calibration.h deleted file mode 100644 index 028853ec8e..0000000000 --- a/apps/systemcmds/calibration/calibration.h +++ /dev/null @@ -1,60 +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. - * - ****************************************************************************/ - -#ifndef _CALIBRATION_H -#define _CALIBRATION_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/**************************************************************************** - * Public Variables - ****************************************************************************/ - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -extern int range_cal(int argc, char *argv[]); -extern int servo_cal(int argc, char *argv[]); - -#endif diff --git a/apps/systemcmds/calibration/channels_cal.c b/apps/systemcmds/calibration/channels_cal.c deleted file mode 100755 index 575138b120..0000000000 --- a/apps/systemcmds/calibration/channels_cal.c +++ /dev/null @@ -1,196 +0,0 @@ -/**************************************************************************** - * channels_cal.c - * - * Copyright (C) 2012 Nils Wenzler. All rights reserved. - * Authors: Nils Wenzler - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ -#include -#include -#include -#include "calibration.h" - -/**************************************************************************** - * Defines - ****************************************************************************/ -#define ABS(a) (((a) < 0) ? -(a) : (a)) -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) - -/**************************************************************************** - * Private Data - ****************************************************************************/ -//Store the values here before writing them to global_data_rc_channels -uint16_t old_values[NR_CHANNELS]; -uint16_t cur_values[NR_CHANNELS]; -uint8_t function_map[NR_CHANNELS]; -char names[12][9]; - - - -/**************************************************************************** - * Private Functions - ****************************************************************************/ -void press_enter_2(void) -{ - int c; - printf("Press CTRL+ENTER to continue... \n"); - fflush(stdout); - - do c = getchar(); while ((c != '\n') && (c != EOF)); -} - -/**This gets all current values and writes them to min or max - */ -uint8_t get_val(uint16_t *buffer) -{ - if (0 == global_data_trylock(&global_data_rc_channels->access_conf)) { - uint8_t i; - - for (i = 0; i < NR_CHANNELS; i++) { - printf("Channel: %i\t RAW Value: %i: \n", i, global_data_rc_channels->chan[i].raw); - buffer[i] = global_data_rc_channels->chan[i].raw; - } - - global_data_unlock(&global_data_rc_channels->access_conf); - return 0; - - } else - return -1; -} - -void set_channel(void) -{ - static uint8_t j = 0; - uint8_t i; - - for (i = 0; i < NR_CHANNELS; i++) { - if (ABS(old_values - cur_values) > 50) { - function_map[j] = i; - strcpy(names[i], global_data_rc_channels->function_names[j]); - j++; - } - } -} - -void write_dat(void) -{ - global_data_lock(&global_data_rc_channels->access_conf); - uint8_t i; - - for (i = 0; i < NR_CHANNELS; i++) { - global_data_rc_channels->function[i] = function_map[i]; - strcpy(global_data_rc_channels->chan[i].name, names[i]); - - printf("Channel %i\t Function %s\n", i, - global_data_rc_channels->chan[i].name); - } - - global_data_unlock(&global_data_rc_channels->access_conf); -} - - -/**************************************************************************** - * Public Functions - ****************************************************************************/ -int channels_cal(int argc, char *argv[]) -{ - - printf("This routine maps the input functions on the remote control\n"); - printf("to the corresponding function (Throttle, Roll,..)\n"); - printf("Always move the stick all the way\n"); - press_enter_2(); - - printf("Pull the THROTTLE stick down\n"); - press_enter_2(); - - while (get_val(old_values)); - - printf("Move the THROTTLE stick up\n "); - press_enter_2(); - - while (get_val(cur_values)); - - set_channel(); - - printf("Pull the PITCH stick down\n"); - press_enter_2(); - - while (get_val(old_values)); - - printf("Move the PITCH stick up\n "); - press_enter_2(); - - while (get_val(cur_values)); - - set_channel(); - - printf("Put the ROLL stick to the left\n"); - press_enter_2(); - - while (get_val(old_values)); - - printf("Put the ROLL stick to the right\n "); - press_enter_2(); - - while (get_val(cur_values)); - - set_channel(); - - printf("Put the YAW stick to the left\n"); - press_enter_2(); - - while (get_val(old_values)); - - printf("Put the YAW stick to the right\n "); - press_enter_2(); - - while (get_val(cur_values)); - - set_channel(); - - uint8_t k; - - for (k = 5; k < NR_CHANNELS; k++) { - function_map[k] = k; - strcpy(names[k], global_data_rc_channels->function_names[k]); - } - -//write the values to global_data_rc_channels - write_dat(); - - return 0; - -} - diff --git a/apps/systemcmds/calibration/range_cal.c b/apps/systemcmds/calibration/range_cal.c deleted file mode 100755 index 159a0d06b7..0000000000 --- a/apps/systemcmds/calibration/range_cal.c +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** - * range_cal.c - * - * Copyright (C) 2012 Nils Wenzler. All rights reserved. - * Authors: Nils Wenzler - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ -#include -#include -#include "calibration.h" - -/**************************************************************************** - * Defines - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ -//Store the values here before writing them to global_data_rc_channels -uint16_t max_values[NR_CHANNELS]; -uint16_t min_values[NR_CHANNELS]; -uint16_t mid_values[NR_CHANNELS]; - - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**This sets the middle values - */ -uint8_t set_mid(void) -{ - if (0 == global_data_trylock(&global_data_rc_channels->access_conf)) { - uint8_t i; - - for (i = 0; i < NR_CHANNELS; i++) { - if (i == global_data_rc_channels->function[ROLL] || - i == global_data_rc_channels->function[YAW] || - i == global_data_rc_channels->function[PITCH]) { - - mid_values[i] = global_data_rc_channels->chan[i].raw; - - } else { - mid_values[i] = (max_values[i] + min_values[i]) / 2; - } - - } - - global_data_unlock(&global_data_rc_channels->access_conf); - return 0; - - } else - return -1; -} - -/**This gets all current values and writes them to min or max - */ -uint8_t get_value(void) -{ - if (0 == global_data_trylock(&global_data_rc_channels->access_conf)) { - uint8_t i; - - for (i = 0; i < NR_CHANNELS; i++) { - //see if the value is bigger or smaller than 1500 (roughly neutral) - //and write to the appropriate array - if (global_data_rc_channels->chan[i].raw != 0 && - global_data_rc_channels->chan[i].raw < 1500) { - min_values[i] = global_data_rc_channels->chan[i].raw; - - } else if (global_data_rc_channels->chan[i].raw != 0 && - global_data_rc_channels->chan[i].raw > 1500) { - max_values[i] = global_data_rc_channels->chan[i].raw; - - } else { - max_values[i] = 0; - min_values[i] = 0; - } - } - - global_data_unlock(&global_data_rc_channels->access_conf); - return 0; - - } else - return -1; -} - - -void write_data(void) -{ - // global_data_lock(&global_data_rc_channels->access_conf); - // uint8_t i; - // for(i=0; i < NR_CHANNELS; i++){ - // //Write the data to global_data_rc_channels (if not 0) - // if(mid_values[i]!=0 && min_values[i]!=0 && max_values[i]!=0){ - // global_data_rc_channels->chan[i].scaling_factor = - // 10000/((max_values[i] - min_values[i])/2); - // - // global_data_rc_channels->chan[i].mid = mid_values[i]; - // } - // - // printf("Channel %i\t Function %s \t\t Min %i\t\t Max %i\t\t Scaling Factor: %i\t Middle Value %i\n", - // i, - // global_data_rc_channels->function_name[global_data_rc_channels->function[i]], - // min_values[i], max_values[i], - // global_data_rc_channels->chan[i].scaling_factor, - // global_data_rc_channels->chan[i].mid); - // } - // global_data_unlock(&global_data_rc_channels->access_conf); - - //Write to the Parameter storage - - global_data_parameter_storage->pm.param_values[PARAM_RC1_MIN] = min_values[0]; - global_data_parameter_storage->pm.param_values[PARAM_RC2_MIN] = min_values[1]; - global_data_parameter_storage->pm.param_values[PARAM_RC3_MIN] = min_values[2]; - global_data_parameter_storage->pm.param_values[PARAM_RC4_MIN] = min_values[3]; - global_data_parameter_storage->pm.param_values[PARAM_RC5_MIN] = min_values[4]; - global_data_parameter_storage->pm.param_values[PARAM_RC6_MIN] = min_values[5]; - global_data_parameter_storage->pm.param_values[PARAM_RC7_MIN] = min_values[6]; - global_data_parameter_storage->pm.param_values[PARAM_RC8_MIN] = min_values[7]; - - - global_data_parameter_storage->pm.param_values[PARAM_RC1_MAX] = max_values[0]; - global_data_parameter_storage->pm.param_values[PARAM_RC2_MAX] = max_values[1]; - global_data_parameter_storage->pm.param_values[PARAM_RC3_MAX] = max_values[2]; - global_data_parameter_storage->pm.param_values[PARAM_RC4_MAX] = max_values[3]; - global_data_parameter_storage->pm.param_values[PARAM_RC5_MAX] = max_values[4]; - global_data_parameter_storage->pm.param_values[PARAM_RC6_MAX] = max_values[5]; - global_data_parameter_storage->pm.param_values[PARAM_RC7_MAX] = max_values[6]; - global_data_parameter_storage->pm.param_values[PARAM_RC8_MAX] = max_values[7]; - - - global_data_parameter_storage->pm.param_values[PARAM_RC1_TRIM] = mid_values[0]; - global_data_parameter_storage->pm.param_values[PARAM_RC2_TRIM] = mid_values[1]; - global_data_parameter_storage->pm.param_values[PARAM_RC3_TRIM] = mid_values[2]; - global_data_parameter_storage->pm.param_values[PARAM_RC4_TRIM] = mid_values[3]; - global_data_parameter_storage->pm.param_values[PARAM_RC5_TRIM] = mid_values[4]; - global_data_parameter_storage->pm.param_values[PARAM_RC6_TRIM] = mid_values[5]; - global_data_parameter_storage->pm.param_values[PARAM_RC7_TRIM] = mid_values[6]; - global_data_parameter_storage->pm.param_values[PARAM_RC8_TRIM] = mid_values[7]; - - usleep(3e6); - uint8_t i; - - for (i = 0; i < NR_CHANNELS; i++) { - printf("Channel %i:\t\t Min %i\t\t Max %i\t\t Scaling Factor: %i\t Middle Value %i\n", - i, - min_values[i], max_values[i], - global_data_rc_channels->chan[i].scaling_factor, - global_data_rc_channels->chan[i].mid); - } - - -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ -int range_cal(int argc, char *argv[]) -{ - - printf("The range calibration routine assumes you already did the channel\n"); - printf("assignment\n"); - printf("This routine chooses the minimum, maximum and middle\n"); - printf("value for each channel separatly. The ROLL, PITCH and YAW function\n"); - printf("get their middle value from the RC direct, for the rest it is\n"); - printf("calculated out of the min and max values.\n"); - press_enter(); - - printf("Hold both sticks in lower left corner and continue\n "); - press_enter(); - usleep(500000); - - while (get_value()); - - printf("Hold both sticks in upper right corner and continue\n"); - press_enter(); - usleep(500000); - - while (get_value()); - - printf("Set the trim to 0 and leave the sticks in the neutral position\n"); - press_enter(); - - //Loop until successfull - while (set_mid()); - - //write the values to global_data_rc_channels - write_data(); - - return 0; - -} - diff --git a/apps/systemcmds/calibration/servo_cal.c b/apps/systemcmds/calibration/servo_cal.c deleted file mode 100644 index 96b3045a95..0000000000 --- a/apps/systemcmds/calibration/servo_cal.c +++ /dev/null @@ -1,264 +0,0 @@ -/**************************************************************************** - * servo_cal.c - * - * Copyright (C) 2012 Nils Wenzler. All rights reserved. - * Authors: Nils Wenzler - * - * 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 NuttX 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. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ -#include -#include -#include -#include -#include "calibration.h" - -/**************************************************************************** - * Defines - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ -//Store the values here before writing them to global_data_rc_channels -uint16_t max_values_servo[PWM_SERVO_MAX_CHANNELS]; -uint16_t min_values_servo[PWM_SERVO_MAX_CHANNELS]; -uint16_t mid_values_servo[PWM_SERVO_MAX_CHANNELS]; - -// Servo loop thread - -pthread_t servo_calib_thread; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**This sets the middle values - */ -uint8_t set_mid_s(void) -{ - if (0 == global_data_trylock(&global_data_rc_channels->access_conf)) { - uint8_t i; - - for (i = 0; i < PWM_SERVO_MAX_CHANNELS; i++) { - if (i == global_data_rc_channels->function[ROLL] || - i == global_data_rc_channels->function[YAW] || - i == global_data_rc_channels->function[PITCH]) { - - mid_values_servo[i] = global_data_rc_channels->chan[i].raw; - - } else { - mid_values_servo[i] = (max_values_servo[i] + min_values_servo[i]) / 2; - } - - } - - global_data_unlock(&global_data_rc_channels->access_conf); - return 0; - - } else - return -1; -} - -/**This gets all current values and writes them to min or max - */ -uint8_t get_value_s(void) -{ - if (0 == global_data_trylock(&global_data_rc_channels->access_conf)) { - uint8_t i; - - for (i = 0; i < PWM_SERVO_MAX_CHANNELS; i++) { - //see if the value is bigger or smaller than 1500 (roughly neutral) - //and write to the appropriate array - if (global_data_rc_channels->chan[i].raw != 0 && - global_data_rc_channels->chan[i].raw < 1500) { - min_values_servo[i] = global_data_rc_channels->chan[i].raw; - - } else if (global_data_rc_channels->chan[i].raw != 0 && - global_data_rc_channels->chan[i].raw > 1500) { - max_values_servo[i] = global_data_rc_channels->chan[i].raw; - - } else { - max_values_servo[i] = 0; - min_values_servo[i] = 0; - } - } - - global_data_unlock(&global_data_rc_channels->access_conf); - return 0; - - } else - return -1; -} - - -void write_data_s(void) -{ - // global_data_lock(&global_data_rc_channels->access_conf); - // uint8_t i; - // for(i=0; i < NR_CHANNELS; i++){ - // //Write the data to global_data_rc_channels (if not 0) - // if(mid_values_servo[i]!=0 && min_values_servo[i]!=0 && max_values_servo[i]!=0){ - // global_data_rc_channels->chan[i].scaling_factor = - // 10000/((max_values_servo[i] - min_values_servo[i])/2); - // - // global_data_rc_channels->chan[i].mid = mid_values_servo[i]; - // } - // - // printf("Channel %i\t Function %s \t\t Min %i\t\t Max %i\t\t Scaling Factor: %i\t Middle Value %i\n", - // i, - // global_data_rc_channels->function_name[global_data_rc_channels->function[i]], - // min_values_servo[i], max_values_servo[i], - // global_data_rc_channels->chan[i].scaling_factor, - // global_data_rc_channels->chan[i].mid); - // } - // global_data_unlock(&global_data_rc_channels->access_conf); - - //Write to the Parameter storage - - - - global_data_lock(&global_data_parameter_storage->access_conf); - - global_data_parameter_storage->pm.param_values[PARAM_SERVO1_MIN] = min_values_servo[0]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO2_MIN] = min_values_servo[1]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO3_MIN] = min_values_servo[2]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO4_MIN] = min_values_servo[3]; - - global_data_parameter_storage->pm.param_values[PARAM_SERVO1_MAX] = max_values_servo[0]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO2_MAX] = max_values_servo[1]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO3_MAX] = max_values_servo[2]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO4_MAX] = max_values_servo[3]; - - global_data_parameter_storage->pm.param_values[PARAM_SERVO1_TRIM] = mid_values_servo[0]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO2_TRIM] = mid_values_servo[1]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO3_TRIM] = mid_values_servo[2]; - global_data_parameter_storage->pm.param_values[PARAM_SERVO4_TRIM] = mid_values_servo[3]; - - global_data_unlock(&global_data_parameter_storage->access_conf); - - usleep(3e6); - uint8_t i; - - for (i = 0; i < NR_CHANNELS; i++) { - printf("Channel %i:\t\t Min %i\t\t Max %i\t\t Scaling Factor: %i\t Middle Value %i\n", - i, - min_values_servo[i], max_values_servo[i], - global_data_rc_channels->chan[i].scaling_factor, - global_data_rc_channels->chan[i].mid); - } - -} - -static void *servo_loop(void *arg) -{ - - // Set thread name - prctl(1, "calibration servo", getpid()); - - // initialize servos - int fd; - servo_position_t data[PWM_SERVO_MAX_CHANNELS]; - - fd = open("/dev/pwm_servo", O_RDWR); - - if (fd < 0) { - printf("failed opening /dev/pwm_servo\n"); - } - - ioctl(fd, PWM_SERVO_ARM, 0); - - while (1) { - int i; - - for (i = 0; i < 4; i++) { - data[i] = global_data_rc_channels->chan[global_data_rc_channels->function[THROTTLE]].raw; - } - - int result = write(fd, &data, sizeof(data)); - - if (result != sizeof(data)) { - printf("failed bulk-reading channel values\n"); - } - - // 5Hz loop - usleep(200000); - } - - return NULL; -} - - -/**************************************************************************** - * Public Functions - ****************************************************************************/ -int servo_cal(int argc, char *argv[]) -{ - // pthread_attr_t servo_loop_attr; - // pthread_attr_init(&servo_loop_attr); - // pthread_attr_setstacksize(&servo_loop_attr, 1024); - pthread_create(&servo_calib_thread, NULL, servo_loop, NULL); - pthread_join(servo_calib_thread, NULL); - - printf("The servo calibration routine assumes you already did the channel\n"); - printf("assignment with 'calibration channels'\n"); - printf("This routine chooses the minimum, maximum and middle\n"); - printf("value for each channel separately. The ROLL, PITCH and YAW function\n"); - printf("get their middle value from the RC direct, for the rest it is\n"); - printf("calculated out of the min and max values.\n"); - press_enter(); - - printf("Hold both sticks in lower left corner and continue\n "); - press_enter(); - usleep(500000); - - while (get_value_s()); - - printf("Hold both sticks in upper right corner and continue\n"); - press_enter(); - usleep(500000); - - while (get_value_s()); - - printf("Set the trim to 0 and leave the sticks in the neutral position\n"); - press_enter(); - - //Loop until successfull - while (set_mid_s()); - - //write the values to global_data_rc_channels - write_data_s(); - - return 0; - -} - diff --git a/apps/systemcmds/perf/.context b/apps/systemcmds/perf/.context deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/systemcmds/reboot/.context b/apps/systemcmds/reboot/.context deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/systemcmds/top/.context b/apps/systemcmds/top/.context deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/systemcmds/top/Makefile b/apps/systemcmds/top/Makefile deleted file mode 100644 index f58f9212e7..0000000000 --- a/apps/systemcmds/top/Makefile +++ /dev/null @@ -1,44 +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. -# -############################################################################ - -# -# realtime system performance display -# - -APPNAME = top -PRIORITY = SCHED_PRIORITY_DEFAULT - 10 -STACKSIZE = 3000 - -include $(APPDIR)/mk/app.mk - -MAXOPTIMIZATION = -Os diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index 44e35bdf9b..b3ebe45532 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -16,9 +16,19 @@ MODULES += drivers/l3gd20 MODULES += drivers/ardrone_interface # -# System utilities +# System commands # MODULES += systemcmds/eeprom +MODULES += systemcmds/bl_update +MODULES += systemcmds/boardinfo +MODULES += systemcmds/i2c +MODULES += systemcmds/mixer +MODULES += systemcmds/param +MODULES += systemcmds/perf +MODULES += systemcmds/preflight_check +MODULES += systemcmds/pwm +MODULES += systemcmds/reboot +MODULES += systemcmds/top MODULES += systemcmds/tests # @@ -48,12 +58,9 @@ endef # command priority stack entrypoint BUILTIN_COMMANDS := \ $(call _B, adc, , 2048, adc_main ) \ - $(call _B, bl_update, , 4096, bl_update_main ) \ $(call _B, blinkm, , 2048, blinkm_main ) \ $(call _B, bma180, , 2048, bma180_main ) \ - $(call _B, boardinfo, , 2048, boardinfo_main ) \ $(call _B, control_demo, , 2048, control_demo_main ) \ - $(call _B, delay_test, , 2048, delay_test_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 ) \ @@ -62,22 +69,15 @@ BUILTIN_COMMANDS := \ $(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, mixer, , 4096, mixer_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, param, , 4096, param_main ) \ - $(call _B, perf, , 2048, perf_main ) \ $(call _B, position_estimator, , 4096, position_estimator_main ) \ - $(call _B, preflight_check, , 2048, preflight_check_main ) \ $(call _B, px4io, , 2048, px4io_main ) \ - $(call _B, reboot, , 2048, reboot_main ) \ $(call _B, sdlog, SCHED_PRIORITY_MAX-30, 2048, sdlog_main ) \ $(call _B, sensors, SCHED_PRIORITY_MAX-5, 4096, sensors_main ) \ $(call _B, sercon, , 2048, sercon_main ) \ $(call _B, serdis, , 2048, serdis_main ) \ $(call _B, tone_alarm, , 2048, tone_alarm_main ) \ - $(call _B, top, SCHED_PRIORITY_DEFAULT-10, 3000, top_main ) \ - $(call _B, param, SCHED_PRIORITY_DEFAULT-10, 2048, param_main ) \ $(call _B, uorb, , 4096, uorb_main ) diff --git a/src/modules/mavlink_onboard/module.mk b/src/modules/mavlink_onboard/module.mk index c40fa042e8..a7a4980faf 100644 --- a/src/modules/mavlink_onboard/module.mk +++ b/src/modules/mavlink_onboard/module.mk @@ -37,6 +37,6 @@ MODULE_COMMAND = mavlink_onboard SRCS = mavlink.c \ - mavlink_receiver.c + mavlink_receiver.c INCLUDE_DIRS += $(MAVLINK_SRC)/include/mavlink diff --git a/apps/systemcmds/bl_update/bl_update.c b/src/systemcmds/bl_update/bl_update.c similarity index 98% rename from apps/systemcmds/bl_update/bl_update.c rename to src/systemcmds/bl_update/bl_update.c index 45715b7918..0569d89f50 100644 --- a/apps/systemcmds/bl_update/bl_update.c +++ b/src/systemcmds/bl_update/bl_update.c @@ -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/systemcmds/bl_update/Makefile b/src/systemcmds/bl_update/module.mk similarity index 88% rename from apps/systemcmds/bl_update/Makefile rename to src/systemcmds/bl_update/module.mk index d05493577a..e8eea045e5 100644 --- a/apps/systemcmds/bl_update/Makefile +++ b/src/systemcmds/bl_update/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,13 +32,12 @@ ############################################################################ # -# Build the eeprom tool. +# Bootloader updater (flashes the FMU USB bootloader software) # -APPNAME = bl_update -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +MODULE_COMMAND = bl_update +SRCS = bl_update.c -include $(APPDIR)/mk/app.mk +MODULE_STACKSIZE = 4096 MAXOPTIMIZATION = -Os diff --git a/apps/systemcmds/boardinfo/boardinfo.c b/src/systemcmds/boardinfo/boardinfo.c similarity index 99% rename from apps/systemcmds/boardinfo/boardinfo.c rename to src/systemcmds/boardinfo/boardinfo.c index fb8b07ef4f..3ff5a066c1 100644 --- a/apps/systemcmds/boardinfo/boardinfo.c +++ b/src/systemcmds/boardinfo/boardinfo.c @@ -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/systemcmds/preflight_check/Makefile b/src/systemcmds/boardinfo/module.mk similarity index 89% rename from apps/systemcmds/preflight_check/Makefile rename to src/systemcmds/boardinfo/module.mk index 98aadaa86f..6851d229b2 100644 --- a/apps/systemcmds/preflight_check/Makefile +++ b/src/systemcmds/boardinfo/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,13 +32,10 @@ ############################################################################ # -# Reboot command. +# Information about FMU and IO boards connected # -APPNAME = preflight_check -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 - -include $(APPDIR)/mk/app.mk +MODULE_COMMAND = boardinfo +SRCS = boardinfo.c MAXOPTIMIZATION = -Os diff --git a/src/systemcmds/eeprom/module.mk b/src/systemcmds/eeprom/module.mk index 3b4fc04791..07f3945be2 100644 --- a/src/systemcmds/eeprom/module.mk +++ b/src/systemcmds/eeprom/module.mk @@ -1,3 +1,36 @@ +############################################################################ +# +# 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. +# +############################################################################ + # # EEPROM file system driver # diff --git a/apps/systemcmds/i2c/i2c.c b/src/systemcmds/i2c/i2c.c similarity index 98% rename from apps/systemcmds/i2c/i2c.c rename to src/systemcmds/i2c/i2c.c index e1babdc12b..4da238039c 100644 --- a/apps/systemcmds/i2c/i2c.c +++ b/src/systemcmds/i2c/i2c.c @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. + * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. * Author: Lorenz Meier * * Redistribution and use in source and binary forms, with or without diff --git a/apps/systemcmds/i2c/Makefile b/src/systemcmds/i2c/module.mk similarity index 91% rename from apps/systemcmds/i2c/Makefile rename to src/systemcmds/i2c/module.mk index 046e747571..ab2357c7d0 100644 --- a/apps/systemcmds/i2c/Makefile +++ b/src/systemcmds/i2c/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,7 @@ # Build the i2c test tool. # -APPNAME = i2c -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +MODULE_COMMAND = i2c +SRCS = i2c.c -include $(APPDIR)/mk/app.mk +MAXOPTIMIZATION = -Os diff --git a/apps/systemcmds/mixer/mixer.c b/src/systemcmds/mixer/mixer.c similarity index 100% rename from apps/systemcmds/mixer/mixer.c rename to src/systemcmds/mixer/mixer.c diff --git a/apps/systemcmds/mixer/Makefile b/src/systemcmds/mixer/module.mk similarity index 91% rename from apps/systemcmds/mixer/Makefile rename to src/systemcmds/mixer/module.mk index 3d8ac38cb7..d5a3f9f77b 100644 --- a/apps/systemcmds/mixer/Makefile +++ b/src/systemcmds/mixer/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,9 @@ # Build the mixer tool. # -APPNAME = mixer -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +MODULE_COMMAND = mixer +SRCS = mixer.c -include $(APPDIR)/mk/app.mk +MODULE_STACKSIZE = 4096 MAXOPTIMIZATION = -Os diff --git a/apps/systemcmds/param/Makefile b/src/systemcmds/param/module.mk similarity index 91% rename from apps/systemcmds/param/Makefile rename to src/systemcmds/param/module.mk index f19cadbb60..63f15ad286 100644 --- a/apps/systemcmds/param/Makefile +++ b/src/systemcmds/param/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 @@ # Build the parameters tool. # -APPNAME = param -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +MODULE_COMMAND = param +SRCS = param.c -include $(APPDIR)/mk/app.mk +MODULE_STACKSIZE = 4096 MAXOPTIMIZATION = -Os + diff --git a/apps/systemcmds/param/param.c b/src/systemcmds/param/param.c similarity index 100% rename from apps/systemcmds/param/param.c rename to src/systemcmds/param/param.c diff --git a/apps/systemcmds/perf/Makefile b/src/systemcmds/perf/module.mk similarity index 91% rename from apps/systemcmds/perf/Makefile rename to src/systemcmds/perf/module.mk index f8bab41b65..77952842b3 100644 --- a/apps/systemcmds/perf/Makefile +++ b/src/systemcmds/perf/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,7 @@ # perf_counter reporting tool # -APPNAME = perf -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 - -include $(APPDIR)/mk/app.mk +MODULE_COMMAND = perf +SRCS = perf.c MAXOPTIMIZATION = -Os diff --git a/apps/systemcmds/perf/perf.c b/src/systemcmds/perf/perf.c similarity index 97% rename from apps/systemcmds/perf/perf.c rename to src/systemcmds/perf/perf.c index 64443d019c..b69ea597b1 100644 --- a/apps/systemcmds/perf/perf.c +++ b/src/systemcmds/perf/perf.c @@ -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/systemcmds/boardinfo/Makefile b/src/systemcmds/preflight_check/module.mk similarity index 86% rename from apps/systemcmds/boardinfo/Makefile rename to src/systemcmds/preflight_check/module.mk index 6f1be149c6..7c3c887836 100644 --- a/apps/systemcmds/boardinfo/Makefile +++ b/src/systemcmds/preflight_check/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,13 +32,11 @@ ############################################################################ # -# Build the boardinfo tool. +# Pre-flight check. Locks down system for a few systems with blinking leds +# and buzzer if the sensors do not report an OK status. # -APPNAME = boardinfo -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 - -include $(APPDIR)/mk/app.mk +MODULE_COMMAND = preflight_check +SRCS = preflight_check.c MAXOPTIMIZATION = -Os diff --git a/apps/systemcmds/preflight_check/preflight_check.c b/src/systemcmds/preflight_check/preflight_check.c similarity index 98% rename from apps/systemcmds/preflight_check/preflight_check.c rename to src/systemcmds/preflight_check/preflight_check.c index 9ac6f0b5e0..42256be61e 100644 --- a/apps/systemcmds/preflight_check/preflight_check.c +++ b/src/systemcmds/preflight_check/preflight_check.c @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012 PX4 Development Team. All rights reserved. + * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved. * Author: @author Lorenz Meier * * Redistribution and use in source and binary forms, with or without diff --git a/apps/systemcmds/pwm/Makefile b/src/systemcmds/pwm/module.mk similarity index 91% rename from apps/systemcmds/pwm/Makefile rename to src/systemcmds/pwm/module.mk index 5ab105ed12..4a23bba90e 100644 --- a/apps/systemcmds/pwm/Makefile +++ b/src/systemcmds/pwm/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,7 @@ # Build the pwm tool. # -APPNAME = pwm -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +MODULE_COMMAND = pwm +SRCS = pwm.c -include $(APPDIR)/mk/app.mk +MODULE_STACKSIZE = 4096 diff --git a/apps/systemcmds/pwm/pwm.c b/src/systemcmds/pwm/pwm.c similarity index 100% rename from apps/systemcmds/pwm/pwm.c rename to src/systemcmds/pwm/pwm.c diff --git a/src/systemcmds/reboot/module.mk b/src/systemcmds/reboot/module.mk new file mode 100644 index 0000000000..19f64af54f --- /dev/null +++ b/src/systemcmds/reboot/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. +# +############################################################################ + +# +# reboot command. +# + +MODULE_COMMAND = reboot +SRCS = reboot.c + +MAXOPTIMIZATION = -Os diff --git a/apps/systemcmds/reboot/reboot.c b/src/systemcmds/reboot/reboot.c similarity index 100% rename from apps/systemcmds/reboot/reboot.c rename to src/systemcmds/reboot/reboot.c diff --git a/apps/systemcmds/reboot/Makefile b/src/systemcmds/top/module.mk similarity index 90% rename from apps/systemcmds/reboot/Makefile rename to src/systemcmds/top/module.mk index 15dd199829..9239aafc31 100644 --- a/apps/systemcmds/reboot/Makefile +++ b/src/systemcmds/top/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,13 +32,13 @@ ############################################################################ # -# Reboot command. +# Build top memory / cpu status tool. # -APPNAME = reboot -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = top +SRCS = top.c -include $(APPDIR)/mk/app.mk +MODULE_STACKSIZE = 3000 MAXOPTIMIZATION = -Os + diff --git a/apps/systemcmds/top/top.c b/src/systemcmds/top/top.c similarity index 100% rename from apps/systemcmds/top/top.c rename to src/systemcmds/top/top.c From e6ed8268ee610d0b9e9b4930ad379a6d7dcc3629 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 12:59:47 +0200 Subject: [PATCH 6/7] Moved position_estimator_mc, px4io driver and sdlog app to new style build --- makefiles/config_px4fmu_default.mk | 15 ++++++++++----- src/drivers/l3gd20/l3gd20.cpp | 5 +++-- .../px4io/Makefile => src/drivers/px4io/module.mk | 9 ++++----- {apps => src}/drivers/px4io/px4io.cpp | 2 +- {apps => src}/drivers/px4io/uploader.cpp | 5 +++-- {apps => src}/drivers/px4io/uploader.h | 5 +++-- .../attitude_estimator_ekf_main.cpp | 1 - src/modules/attitude_estimator_ekf/module.mk | 8 ++++---- src/modules/commander/module.mk | 2 +- .../position_estimator_mc/codegen/kalman_dlqe1.c | 0 .../position_estimator_mc/codegen/kalman_dlqe1.h | 0 .../codegen/kalman_dlqe1_initialize.c | 0 .../codegen/kalman_dlqe1_initialize.h | 0 .../codegen/kalman_dlqe1_terminate.c | 0 .../codegen/kalman_dlqe1_terminate.h | 0 .../codegen/kalman_dlqe1_types.h | 0 .../position_estimator_mc/codegen/kalman_dlqe2.c | 0 .../position_estimator_mc/codegen/kalman_dlqe2.h | 0 .../codegen/kalman_dlqe2_initialize.c | 0 .../codegen/kalman_dlqe2_initialize.h | 0 .../codegen/kalman_dlqe2_terminate.c | 0 .../codegen/kalman_dlqe2_terminate.h | 0 .../codegen/kalman_dlqe2_types.h | 0 .../position_estimator_mc/codegen/kalman_dlqe3.c | 0 .../position_estimator_mc/codegen/kalman_dlqe3.h | 0 .../codegen/kalman_dlqe3_data.c | 0 .../codegen/kalman_dlqe3_data.h | 0 .../codegen/kalman_dlqe3_initialize.c | 0 .../codegen/kalman_dlqe3_initialize.h | 0 .../codegen/kalman_dlqe3_terminate.c | 0 .../codegen/kalman_dlqe3_terminate.h | 0 .../codegen/kalman_dlqe3_types.h | 0 .../codegen/positionKalmanFilter1D.c | 0 .../codegen/positionKalmanFilter1D.h | 0 .../codegen/positionKalmanFilter1D_dT.c | 0 .../codegen/positionKalmanFilter1D_dT.h | 0 .../positionKalmanFilter1D_dT_initialize.c | 0 .../positionKalmanFilter1D_dT_initialize.h | 0 .../codegen/positionKalmanFilter1D_dT_terminate.c | 0 .../codegen/positionKalmanFilter1D_dT_terminate.h | 0 .../codegen/positionKalmanFilter1D_dT_types.h | 0 .../codegen/positionKalmanFilter1D_initialize.c | 0 .../codegen/positionKalmanFilter1D_initialize.h | 0 .../codegen/positionKalmanFilter1D_terminate.c | 0 .../codegen/positionKalmanFilter1D_terminate.h | 0 .../codegen/positionKalmanFilter1D_types.h | 0 .../position_estimator_mc/codegen/randn.c | 0 .../position_estimator_mc/codegen/randn.h | 0 .../position_estimator_mc/codegen/rtGetInf.c | 0 .../position_estimator_mc/codegen/rtGetInf.h | 0 .../position_estimator_mc/codegen/rtGetNaN.c | 0 .../position_estimator_mc/codegen/rtGetNaN.h | 0 .../position_estimator_mc/codegen/rt_nonfinite.c | 0 .../position_estimator_mc/codegen/rt_nonfinite.h | 0 .../position_estimator_mc/codegen/rtwtypes.h | 0 .../modules}/position_estimator_mc/kalman_dlqe1.m | 0 .../modules}/position_estimator_mc/kalman_dlqe2.m | 0 .../modules}/position_estimator_mc/kalman_dlqe3.m | 0 .../modules/position_estimator_mc/module.mk | 10 +++------- .../positionKalmanFilter1D.m | 0 .../positionKalmanFilter1D_dT.m | 0 .../position_estimator_mc_main.c | 0 .../position_estimator_mc_params.c | 0 .../position_estimator_mc_params.h | 0 .../sdlog/Makefile => src/modules/sdlog/module.mk | 10 +++++----- {apps => src/modules}/sdlog/sdlog.c | 0 {apps => src/modules}/sdlog/sdlog_ringbuffer.c | 0 {apps => src/modules}/sdlog/sdlog_ringbuffer.h | 0 68 files changed, 37 insertions(+), 35 deletions(-) rename apps/drivers/px4io/Makefile => src/drivers/px4io/module.mk (91%) rename {apps => src}/drivers/px4io/px4io.cpp (99%) rename {apps => src}/drivers/px4io/uploader.cpp (99%) rename {apps => src}/drivers/px4io/uploader.h (95%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe1.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe1.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe1_initialize.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe1_initialize.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe1_terminate.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe1_terminate.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe1_types.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe2.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe2.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe2_initialize.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe2_initialize.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe2_terminate.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe2_terminate.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe2_types.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3_data.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3_data.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3_initialize.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3_initialize.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3_terminate.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3_terminate.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/kalman_dlqe3_types.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_dT.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_dT.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_dT_types.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/positionKalmanFilter1D_types.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/randn.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/randn.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/rtGetInf.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/rtGetInf.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/rtGetNaN.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/rtGetNaN.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/rt_nonfinite.c (100%) rename {apps => src/modules}/position_estimator_mc/codegen/rt_nonfinite.h (100%) rename {apps => src/modules}/position_estimator_mc/codegen/rtwtypes.h (100%) rename {apps => src/modules}/position_estimator_mc/kalman_dlqe1.m (100%) rename {apps => src/modules}/position_estimator_mc/kalman_dlqe2.m (100%) rename {apps => src/modules}/position_estimator_mc/kalman_dlqe3.m (100%) rename apps/position_estimator_mc/Makefile => src/modules/position_estimator_mc/module.mk (91%) rename {apps => src/modules}/position_estimator_mc/positionKalmanFilter1D.m (100%) rename {apps => src/modules}/position_estimator_mc/positionKalmanFilter1D_dT.m (100%) rename {apps => src/modules}/position_estimator_mc/position_estimator_mc_main.c (100%) rename {apps => src/modules}/position_estimator_mc/position_estimator_mc_params.c (100%) rename {apps => src/modules}/position_estimator_mc/position_estimator_mc_params.h (100%) rename apps/sdlog/Makefile => src/modules/sdlog/module.mk (90%) rename {apps => src/modules}/sdlog/sdlog.c (100%) rename {apps => src/modules}/sdlog/sdlog_ringbuffer.c (100%) rename {apps => src/modules}/sdlog/sdlog_ringbuffer.h (100%) diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index b3ebe45532..80c34d5dd9 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -14,6 +14,9 @@ MODULES += drivers/px4fmu MODULES += drivers/boards/px4fmu MODULES += drivers/l3gd20 MODULES += drivers/ardrone_interface +MODULES += drivers/px4io +# sensors app is WIP +#MODULES += modules/sensors # # System commands @@ -41,7 +44,13 @@ MODULES += modules/mavlink_onboard # # Estimation modules (EKF / other filters) # -#MODULES += modules/attitude_estimator_ekf +MODULES += modules/attitude_estimator_ekf +MODULES += modules/position_estimator_mc + +# +# Logging +# +MODULES += modules/sdlog # # Transitional support - add commands from the NuttX export archive. @@ -73,10 +82,6 @@ BUILTIN_COMMANDS := \ $(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, position_estimator, , 4096, position_estimator_main ) \ - $(call _B, px4io, , 2048, px4io_main ) \ - $(call _B, sdlog, SCHED_PRIORITY_MAX-30, 2048, sdlog_main ) \ - $(call _B, sensors, SCHED_PRIORITY_MAX-5, 4096, sensors_main ) \ $(call _B, sercon, , 2048, sercon_main ) \ $(call _B, serdis, , 2048, serdis_main ) \ $(call _B, tone_alarm, , 2048, tone_alarm_main ) \ diff --git a/src/drivers/l3gd20/l3gd20.cpp b/src/drivers/l3gd20/l3gd20.cpp index c7f433dd47..98098c83bf 100644 --- a/src/drivers/l3gd20/l3gd20.cpp +++ b/src/drivers/l3gd20/l3gd20.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 @@ -32,7 +32,8 @@ ****************************************************************************/ /** - * @file Driver for the ST L3GD20 MEMS gyro connected via SPI. + * @file l3gd20.cpp + * Driver for the ST L3GD20 MEMS gyro connected via SPI. */ #include diff --git a/apps/drivers/px4io/Makefile b/src/drivers/px4io/module.mk similarity index 91% rename from apps/drivers/px4io/Makefile rename to src/drivers/px4io/module.mk index cbd9425463..328e5a6843 100644 --- a/apps/drivers/px4io/Makefile +++ b/src/drivers/px4io/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,7 @@ # Interface driver for the PX4IO board. # -APPNAME = px4io -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 2048 +MODULE_COMMAND = px4io -include $(APPDIR)/mk/app.mk +SRCS = px4io.cpp \ + uploader.cpp diff --git a/apps/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp similarity index 99% rename from apps/drivers/px4io/px4io.cpp rename to src/drivers/px4io/px4io.cpp index 4f6938a144..b21f83e442 100644 --- a/apps/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * - * Copyright (C) 2012,2013 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/px4io/uploader.cpp b/src/drivers/px4io/uploader.cpp similarity index 99% rename from apps/drivers/px4io/uploader.cpp rename to src/drivers/px4io/uploader.cpp index abf59216a6..9a67875e86 100644 --- a/apps/drivers/px4io/uploader.cpp +++ b/src/drivers/px4io/uploader.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 @@ -32,7 +32,8 @@ ****************************************************************************/ /** - * @file Firmware uploader for PX4IO + * @file uploader.cpp + * Firmware uploader for PX4IO */ #include diff --git a/apps/drivers/px4io/uploader.h b/src/drivers/px4io/uploader.h similarity index 95% rename from apps/drivers/px4io/uploader.h rename to src/drivers/px4io/uploader.h index f983d19811..135202dd1b 100644 --- a/apps/drivers/px4io/uploader.h +++ b/src/drivers/px4io/uploader.h @@ -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,8 @@ ****************************************************************************/ /** - * @file Firmware uploader for PX4IO + * @file uploader.h + * Firmware uploader definitions for PX4IO. */ #ifndef _PX4IO_UPLOADER_H diff --git a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp index 1a50dde0f4..8e18c3c9a7 100755 --- a/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp +++ b/src/modules/attitude_estimator_ekf/attitude_estimator_ekf_main.cpp @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include diff --git a/src/modules/attitude_estimator_ekf/module.mk b/src/modules/attitude_estimator_ekf/module.mk index bfb7db9977..d98647f999 100644 --- a/src/modules/attitude_estimator_ekf/module.mk +++ b/src/modules/attitude_estimator_ekf/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012-2013 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 @@ # Attitude estimator (Extended Kalman Filter) # -MODULE_NAME = attitude_estimator_ekf -CXXSRCS = attitude_estimator_ekf_main.cpp +MODULE_COMMAND = attitude_estimator_ekf -SRCS = attitude_estimator_ekf_params.c \ +SRCS = attitude_estimator_ekf_main.cpp \ + attitude_estimator_ekf_params.c \ codegen/eye.c \ codegen/attitudeKalmanfilter.c \ codegen/mrdivide.c \ diff --git a/src/modules/commander/module.mk b/src/modules/commander/module.mk index b90da8289f..556d5c2df6 100644 --- a/src/modules/commander/module.mk +++ b/src/modules/commander/module.mk @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2012-2013 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/position_estimator_mc/codegen/kalman_dlqe1.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe1.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe1.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe1.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe1.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe1.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe1.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe1.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe1_initialize.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe1_initialize.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe1_initialize.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe1_initialize.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe1_initialize.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe1_initialize.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe1_initialize.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe1_initialize.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe1_terminate.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe1_terminate.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe1_terminate.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe1_terminate.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe1_terminate.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe1_terminate.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe1_terminate.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe1_terminate.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe1_types.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe1_types.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe1_types.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe1_types.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe2.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe2.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe2.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe2.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe2.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe2.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe2.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe2.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe2_initialize.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe2_initialize.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe2_initialize.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe2_initialize.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe2_initialize.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe2_initialize.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe2_initialize.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe2_initialize.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe2_terminate.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe2_terminate.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe2_terminate.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe2_terminate.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe2_terminate.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe2_terminate.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe2_terminate.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe2_terminate.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe2_types.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe2_types.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe2_types.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe2_types.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe3.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe3.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3_data.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe3_data.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3_data.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3_data.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3_data.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe3_data.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3_data.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3_data.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3_initialize.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe3_initialize.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3_initialize.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3_initialize.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3_initialize.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe3_initialize.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3_initialize.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3_initialize.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3_terminate.c b/src/modules/position_estimator_mc/codegen/kalman_dlqe3_terminate.c similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3_terminate.c rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3_terminate.c diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3_terminate.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe3_terminate.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3_terminate.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3_terminate.h diff --git a/apps/position_estimator_mc/codegen/kalman_dlqe3_types.h b/src/modules/position_estimator_mc/codegen/kalman_dlqe3_types.h similarity index 100% rename from apps/position_estimator_mc/codegen/kalman_dlqe3_types.h rename to src/modules/position_estimator_mc/codegen/kalman_dlqe3_types.h diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D.c b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D.c similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D.c rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D.c diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D.h b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D.h similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D.h rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D.h diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT.c b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT.c similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT.c rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT.c diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT.h b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT.h similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT.h rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT.h diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.c b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.c similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.c rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.c diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.h b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.h similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.h rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_initialize.h diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.c b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.c similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.c rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.c diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.h b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.h similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.h rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_terminate.h diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_types.h b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_types.h similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_dT_types.h rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_dT_types.h diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.c b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.c similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.c rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.c diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.h b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.h similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.h rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_initialize.h diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.c b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.c similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.c rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.c diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.h b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.h similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.h rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_terminate.h diff --git a/apps/position_estimator_mc/codegen/positionKalmanFilter1D_types.h b/src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_types.h similarity index 100% rename from apps/position_estimator_mc/codegen/positionKalmanFilter1D_types.h rename to src/modules/position_estimator_mc/codegen/positionKalmanFilter1D_types.h diff --git a/apps/position_estimator_mc/codegen/randn.c b/src/modules/position_estimator_mc/codegen/randn.c similarity index 100% rename from apps/position_estimator_mc/codegen/randn.c rename to src/modules/position_estimator_mc/codegen/randn.c diff --git a/apps/position_estimator_mc/codegen/randn.h b/src/modules/position_estimator_mc/codegen/randn.h similarity index 100% rename from apps/position_estimator_mc/codegen/randn.h rename to src/modules/position_estimator_mc/codegen/randn.h diff --git a/apps/position_estimator_mc/codegen/rtGetInf.c b/src/modules/position_estimator_mc/codegen/rtGetInf.c similarity index 100% rename from apps/position_estimator_mc/codegen/rtGetInf.c rename to src/modules/position_estimator_mc/codegen/rtGetInf.c diff --git a/apps/position_estimator_mc/codegen/rtGetInf.h b/src/modules/position_estimator_mc/codegen/rtGetInf.h similarity index 100% rename from apps/position_estimator_mc/codegen/rtGetInf.h rename to src/modules/position_estimator_mc/codegen/rtGetInf.h diff --git a/apps/position_estimator_mc/codegen/rtGetNaN.c b/src/modules/position_estimator_mc/codegen/rtGetNaN.c similarity index 100% rename from apps/position_estimator_mc/codegen/rtGetNaN.c rename to src/modules/position_estimator_mc/codegen/rtGetNaN.c diff --git a/apps/position_estimator_mc/codegen/rtGetNaN.h b/src/modules/position_estimator_mc/codegen/rtGetNaN.h similarity index 100% rename from apps/position_estimator_mc/codegen/rtGetNaN.h rename to src/modules/position_estimator_mc/codegen/rtGetNaN.h diff --git a/apps/position_estimator_mc/codegen/rt_nonfinite.c b/src/modules/position_estimator_mc/codegen/rt_nonfinite.c similarity index 100% rename from apps/position_estimator_mc/codegen/rt_nonfinite.c rename to src/modules/position_estimator_mc/codegen/rt_nonfinite.c diff --git a/apps/position_estimator_mc/codegen/rt_nonfinite.h b/src/modules/position_estimator_mc/codegen/rt_nonfinite.h similarity index 100% rename from apps/position_estimator_mc/codegen/rt_nonfinite.h rename to src/modules/position_estimator_mc/codegen/rt_nonfinite.h diff --git a/apps/position_estimator_mc/codegen/rtwtypes.h b/src/modules/position_estimator_mc/codegen/rtwtypes.h similarity index 100% rename from apps/position_estimator_mc/codegen/rtwtypes.h rename to src/modules/position_estimator_mc/codegen/rtwtypes.h diff --git a/apps/position_estimator_mc/kalman_dlqe1.m b/src/modules/position_estimator_mc/kalman_dlqe1.m similarity index 100% rename from apps/position_estimator_mc/kalman_dlqe1.m rename to src/modules/position_estimator_mc/kalman_dlqe1.m diff --git a/apps/position_estimator_mc/kalman_dlqe2.m b/src/modules/position_estimator_mc/kalman_dlqe2.m similarity index 100% rename from apps/position_estimator_mc/kalman_dlqe2.m rename to src/modules/position_estimator_mc/kalman_dlqe2.m diff --git a/apps/position_estimator_mc/kalman_dlqe3.m b/src/modules/position_estimator_mc/kalman_dlqe3.m similarity index 100% rename from apps/position_estimator_mc/kalman_dlqe3.m rename to src/modules/position_estimator_mc/kalman_dlqe3.m diff --git a/apps/position_estimator_mc/Makefile b/src/modules/position_estimator_mc/module.mk similarity index 91% rename from apps/position_estimator_mc/Makefile rename to src/modules/position_estimator_mc/module.mk index 8f11001580..40b135ea4f 100644 --- a/apps/position_estimator_mc/Makefile +++ b/src/modules/position_estimator_mc/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,11 +35,9 @@ # Makefile to build the position estimator # -APPNAME = position_estimator_mc -PRIORITY = SCHED_PRIORITY_DEFAULT -STACKSIZE = 4096 +MODULE_COMMAND = position_estimator_mc -CSRCS = position_estimator_mc_main.c \ +SRCS = position_estimator_mc_main.c \ position_estimator_mc_params.c \ codegen/positionKalmanFilter1D_initialize.c \ codegen/positionKalmanFilter1D_terminate.c \ @@ -60,5 +58,3 @@ CSRCS = position_estimator_mc_main.c \ codegen/kalman_dlqe3_terminate.c \ codegen/kalman_dlqe3_data.c \ codegen/randn.c - -include $(APPDIR)/mk/app.mk diff --git a/apps/position_estimator_mc/positionKalmanFilter1D.m b/src/modules/position_estimator_mc/positionKalmanFilter1D.m similarity index 100% rename from apps/position_estimator_mc/positionKalmanFilter1D.m rename to src/modules/position_estimator_mc/positionKalmanFilter1D.m diff --git a/apps/position_estimator_mc/positionKalmanFilter1D_dT.m b/src/modules/position_estimator_mc/positionKalmanFilter1D_dT.m similarity index 100% rename from apps/position_estimator_mc/positionKalmanFilter1D_dT.m rename to src/modules/position_estimator_mc/positionKalmanFilter1D_dT.m diff --git a/apps/position_estimator_mc/position_estimator_mc_main.c b/src/modules/position_estimator_mc/position_estimator_mc_main.c similarity index 100% rename from apps/position_estimator_mc/position_estimator_mc_main.c rename to src/modules/position_estimator_mc/position_estimator_mc_main.c diff --git a/apps/position_estimator_mc/position_estimator_mc_params.c b/src/modules/position_estimator_mc/position_estimator_mc_params.c similarity index 100% rename from apps/position_estimator_mc/position_estimator_mc_params.c rename to src/modules/position_estimator_mc/position_estimator_mc_params.c diff --git a/apps/position_estimator_mc/position_estimator_mc_params.h b/src/modules/position_estimator_mc/position_estimator_mc_params.h similarity index 100% rename from apps/position_estimator_mc/position_estimator_mc_params.h rename to src/modules/position_estimator_mc/position_estimator_mc_params.h diff --git a/apps/sdlog/Makefile b/src/modules/sdlog/module.mk similarity index 90% rename from apps/sdlog/Makefile rename to src/modules/sdlog/module.mk index 225b14a322..89da2d8273 100644 --- a/apps/sdlog/Makefile +++ b/src/modules/sdlog/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,9 +35,9 @@ # sdlog Application # -APPNAME = sdlog +MODULE_COMMAND = sdlog # The main thread only buffers to RAM, needs a high priority -PRIORITY = SCHED_PRIORITY_MAX - 30 -STACKSIZE = 2048 +MODULE_PRIORITY = "SCHED_PRIORITY_MAX-30" -include $(APPDIR)/mk/app.mk +SRCS = sdlog.c \ + sdlog_ringbuffer.c diff --git a/apps/sdlog/sdlog.c b/src/modules/sdlog/sdlog.c similarity index 100% rename from apps/sdlog/sdlog.c rename to src/modules/sdlog/sdlog.c diff --git a/apps/sdlog/sdlog_ringbuffer.c b/src/modules/sdlog/sdlog_ringbuffer.c similarity index 100% rename from apps/sdlog/sdlog_ringbuffer.c rename to src/modules/sdlog/sdlog_ringbuffer.c diff --git a/apps/sdlog/sdlog_ringbuffer.h b/src/modules/sdlog/sdlog_ringbuffer.h similarity index 100% rename from apps/sdlog/sdlog_ringbuffer.h rename to src/modules/sdlog/sdlog_ringbuffer.h From c89f46f59055f4cc0d7ada4a26e48f021278538e Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 27 Apr 2013 13:16:24 +0200 Subject: [PATCH 7/7] Moved sensors app to new world --- makefiles/config_px4fmu_default.mk | 3 +-- {apps => src/modules}/sensors/.context | 0 .../Makefile => src/modules/sensors/module.mk | 13 +++++-------- {apps => src/modules}/sensors/sensor_params.c | 0 {apps => src/modules}/sensors/sensors.cpp | 0 5 files changed, 6 insertions(+), 10 deletions(-) rename {apps => src/modules}/sensors/.context (100%) rename apps/sensors/Makefile => src/modules/sensors/module.mk (88%) rename {apps => src/modules}/sensors/sensor_params.c (100%) rename {apps => src/modules}/sensors/sensors.cpp (100%) diff --git a/makefiles/config_px4fmu_default.mk b/makefiles/config_px4fmu_default.mk index 80c34d5dd9..aae7e9b0e1 100644 --- a/makefiles/config_px4fmu_default.mk +++ b/makefiles/config_px4fmu_default.mk @@ -15,8 +15,7 @@ MODULES += drivers/boards/px4fmu MODULES += drivers/l3gd20 MODULES += drivers/ardrone_interface MODULES += drivers/px4io -# sensors app is WIP -#MODULES += modules/sensors +MODULES += modules/sensors # # System commands diff --git a/apps/sensors/.context b/src/modules/sensors/.context similarity index 100% rename from apps/sensors/.context rename to src/modules/sensors/.context diff --git a/apps/sensors/Makefile b/src/modules/sensors/module.mk similarity index 88% rename from apps/sensors/Makefile rename to src/modules/sensors/module.mk index 526fb0164f..ebbc580e10 100644 --- a/apps/sensors/Makefile +++ b/src/modules/sensors/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,11 +35,8 @@ # Makefile to build the sensor data collector # -APPNAME = sensors -PRIORITY = SCHED_PRIORITY_MAX-5 -STACKSIZE = 4096 +MODULE_COMMAND = sensors +MODULE_PRIORITY = "SCHED_PRIORITY_MAX-5" -CXXSRCS = sensors.cpp -CSRCS = sensor_params.c - -include $(APPDIR)/mk/app.mk +SRCS = sensors.cpp \ + sensor_params.c diff --git a/apps/sensors/sensor_params.c b/src/modules/sensors/sensor_params.c similarity index 100% rename from apps/sensors/sensor_params.c rename to src/modules/sensors/sensor_params.c diff --git a/apps/sensors/sensors.cpp b/src/modules/sensors/sensors.cpp similarity index 100% rename from apps/sensors/sensors.cpp rename to src/modules/sensors/sensors.cpp