diff --git a/boards/beaglebone/blue/default.px4board b/boards/beaglebone/blue/default.px4board index 3c51c354afb..2f973c67da7 100644 --- a/boards/beaglebone/blue/default.px4board +++ b/boards/beaglebone/blue/default.px4board @@ -76,7 +76,5 @@ CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y CONFIG_EXAMPLES_FAKE_IMU=y CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/bluerobotics/navigator/default.px4board b/boards/bluerobotics/navigator/default.px4board index 535a56d0f06..9e01ed22023 100644 --- a/boards/bluerobotics/navigator/default.px4board +++ b/boards/bluerobotics/navigator/default.px4board @@ -71,7 +71,5 @@ CONFIG_SYSTEMCMDS_VER=y CONFIG_SYSTEMCMDS_WORK_QUEUE=y CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/emlid/navio2/default.px4board b/boards/emlid/navio2/default.px4board index 132afaaaaf2..31c192fdf59 100644 --- a/boards/emlid/navio2/default.px4board +++ b/boards/emlid/navio2/default.px4board @@ -78,7 +78,5 @@ CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y CONFIG_EXAMPLES_FAKE_IMU=y CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/nxp/ucans32k146/default.px4board b/boards/nxp/ucans32k146/default.px4board index c97c653508e..45430b9c51b 100644 --- a/boards/nxp/ucans32k146/default.px4board +++ b/boards/nxp/ucans32k146/default.px4board @@ -45,4 +45,3 @@ CONFIG_SYSTEMCMDS_TOPIC_LISTENER=y CONFIG_SYSTEMCMDS_UORB=y CONFIG_SYSTEMCMDS_VER=y CONFIG_SYSTEMCMDS_WORK_QUEUE=y -CONFIG_EXAMPLES_HELLO=y diff --git a/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig b/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig index 433701bf110..3433889dadd 100644 --- a/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig +++ b/boards/nxp/ucans32k146/nuttx-config/nsh/defconfig @@ -36,7 +36,6 @@ CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_ETC_CROMFS=y CONFIG_ETC_ROMFS=y CONFIG_ETC_ROMFSSECTSIZE=128 -CONFIG_EXAMPLES_HELLO=y CONFIG_FS_CROMFS=y CONFIG_FS_PROCFS=y CONFIG_HAVE_CXX=y diff --git a/boards/px4/raspberrypi/default.px4board b/boards/px4/raspberrypi/default.px4board index a9c844ab475..0e0a4facab4 100644 --- a/boards/px4/raspberrypi/default.px4board +++ b/boards/px4/raspberrypi/default.px4board @@ -75,7 +75,5 @@ CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y CONFIG_EXAMPLES_FAKE_IMU=y CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/px4/sitl/default.px4board b/boards/px4/sitl/default.px4board index 6819150528d..7902f85f658 100644 --- a/boards/px4/sitl/default.px4board +++ b/boards/px4/sitl/default.px4board @@ -87,8 +87,6 @@ CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y CONFIG_EXAMPLES_FAKE_IMU=y CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y CONFIG_MODULES_SPACECRAFT=n diff --git a/boards/px4/sitl/neural.px4board b/boards/px4/sitl/neural.px4board index 5db8d651cd8..84ab976abf5 100644 --- a/boards/px4/sitl/neural.px4board +++ b/boards/px4/sitl/neural.px4board @@ -71,7 +71,5 @@ CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y CONFIG_EXAMPLES_FAKE_IMU=y CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/boards/px4/sitl/raptor.px4board b/boards/px4/sitl/raptor.px4board index 90bdd3e5cd8..1d8a2b4b0e1 100644 --- a/boards/px4/sitl/raptor.px4board +++ b/boards/px4/sitl/raptor.px4board @@ -13,8 +13,6 @@ CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y CONFIG_EXAMPLES_FAKE_IMU=y CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y CONFIG_FIGURE_OF_EIGHT=y diff --git a/boards/px4/sitl/vtest-moving.px4board b/boards/px4/sitl/vtest-moving.px4board index 64776d7594f..8ee65f56b2c 100644 --- a/boards/px4/sitl/vtest-moving.px4board +++ b/boards/px4/sitl/vtest-moving.px4board @@ -80,8 +80,6 @@ CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y CONFIG_EXAMPLES_FAKE_IMU=y CONFIG_EXAMPLES_FAKE_MAGNETOMETER=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y CONFIG_MODULES_SPACECRAFT=n diff --git a/boards/scumaker/pilotpi/default.px4board b/boards/scumaker/pilotpi/default.px4board index 117b028420a..addf6d1d973 100644 --- a/boards/scumaker/pilotpi/default.px4board +++ b/boards/scumaker/pilotpi/default.px4board @@ -70,7 +70,5 @@ CONFIG_SYSTEMCMDS_VER=y CONFIG_SYSTEMCMDS_WORK_QUEUE=y CONFIG_EXAMPLES_DYN_HELLO=y CONFIG_EXAMPLES_FAKE_GPS=y -CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG=y CONFIG_EXAMPLES_PX4_SIMPLE_APP=y CONFIG_EXAMPLES_WORK_ITEM=y diff --git a/docs/en/debug/debug_values.md b/docs/en/debug/debug_values.md index ba2c183c8ac..5c550230d2e 100644 --- a/docs/en/debug/debug_values.md +++ b/docs/en/debug/debug_values.md @@ -19,11 +19,6 @@ Here is a table that summarizes the mapping between MAVLink debug messages and u This tutorial shows how to send the MAVLink message `NAMED_VALUE_FLOAT` using the associated uORB topic `debug_key_value`. -The code for this tutorial is available here: - -- [Debug Tutorial Code](https://github.com/PX4/PX4-Autopilot/blob/main/src/examples/px4_mavlink_debug/px4_mavlink_debug.cpp) -- [Enable the tutorial app](https://github.com/PX4/PX4-Autopilot/blob/main/boards/px4/fmu-v5/default.px4board) by ensuring the MAVLink debug app (**CONFIG_EXAMPLES_PX4_MAVLINK_DEBUG**) is in the config of your board and set to 'y'. - All required to set up a debug publication is this code snippet. First add the header file: diff --git a/src/examples/hello/CMakeLists.txt b/src/examples/hello/CMakeLists.txt deleted file mode 100644 index f77407194a7..00000000000 --- a/src/examples/hello/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ - -px4_add_module( - MODULE examples__hello - MAIN hello - COMPILE_FLAGS - SRCS - hello_main.cpp - hello_start.cpp - hello_example.cpp - DEPENDS - ) diff --git a/src/examples/hello/Kconfig b/src/examples/hello/Kconfig deleted file mode 100644 index 3424824a643..00000000000 --- a/src/examples/hello/Kconfig +++ /dev/null @@ -1,5 +0,0 @@ -menuconfig EXAMPLES_HELLO - bool "hello" - default n - ---help--- - Enable support for hello diff --git a/src/examples/hello/hello_example.cpp b/src/examples/hello/hello_example.cpp deleted file mode 100644 index 1c3d2fed4f8..00000000000 --- a/src/examples/hello/hello_example.cpp +++ /dev/null @@ -1,63 +0,0 @@ - -/**************************************************************************** - * - * Copyright (C) 2015 Mark Charlebois. 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. - * - ****************************************************************************/ - -/** - * @file hello_example.cpp - * Example for Linux - * - * @author Mark Charlebois - */ - -#include "hello_example.h" -#include -#include -#include - -px4::AppState HelloExample::appState; - -int HelloExample::main() -{ - appState.setRunning(true); - - int i = 0; - - while (!appState.exitRequested() && i < 5) { - px4_sleep(2); - - printf(" Doing work...\n"); - ++i; - } - - return 0; -} diff --git a/src/examples/hello/hello_example.h b/src/examples/hello/hello_example.h deleted file mode 100644 index 48eb882abea..00000000000 --- a/src/examples/hello/hello_example.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 Mark Charlebois. 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. - * - ****************************************************************************/ - -/** - * @file hello_example.h - * Example app for Linux - * - * @author Mark Charlebois - */ -#pragma once - -#include - -class HelloExample -{ -public: - HelloExample() {} - - ~HelloExample() {} - - int main(); - - static px4::AppState appState; /* track requests to terminate app */ -}; diff --git a/src/examples/hello/hello_main.cpp b/src/examples/hello/hello_main.cpp deleted file mode 100644 index 7cdd117956b..00000000000 --- a/src/examples/hello/hello_main.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 Mark Charlebois. 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. - * - ****************************************************************************/ - -/** - * @file hello_main.cpp - * Example for Linux - * - * @author Mark Charlebois - */ - -#include "hello_example.h" - -#include -#include -#include - -int PX4_MAIN(int argc, char **argv) -{ - px4::init(argc, argv, "hello"); - - printf("hello\n"); - HelloExample hello; - hello.main(); - - printf("goodbye\n"); - return 0; -} diff --git a/src/examples/hello/hello_start.cpp b/src/examples/hello/hello_start.cpp deleted file mode 100644 index 78837f1679e..00000000000 --- a/src/examples/hello/hello_start.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2015 Mark Charlebois. 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. - * - ****************************************************************************/ - -/** - * @file hello_start.cpp - * - * @author Thomas Gubler - * @author Mark Charlebois - */ -#include "hello_example.h" - -#include -#include -#include -#include -#include -#include - -static int daemon_task; /* Handle of deamon task / thread */ - -//using namespace px4; - -extern "C" __EXPORT int hello_main(int argc, char *argv[]); -int hello_main(int argc, char *argv[]) -{ - - if (argc < 2) { - PX4_WARN("usage: hello {start|stop|status}\n"); - return 1; - } - - if (!strcmp(argv[1], "start")) { - - if (HelloExample::appState.isRunning()) { - PX4_INFO("already running\n"); - /* this is not an error */ - return 0; - } - - daemon_task = px4_task_spawn_cmd("hello", - SCHED_DEFAULT, - SCHED_PRIORITY_MAX - 5, - 2000, - PX4_MAIN, - (argv) ? (char *const *)&argv[2] : (char *const *)nullptr); - - return 0; - } - - if (!strcmp(argv[1], "stop")) { - HelloExample::appState.requestExit(); - return 0; - } - - if (!strcmp(argv[1], "status")) { - if (HelloExample::appState.isRunning()) { - PX4_INFO("is running\n"); - - } else { - PX4_INFO("not started\n"); - } - - return 0; - } - - PX4_WARN("usage: hello_main {start|stop|status}\n"); - return 1; -} diff --git a/src/examples/matlab_csv_serial/CMakeLists.txt b/src/examples/matlab_csv_serial/CMakeLists.txt deleted file mode 100644 index 9cc4294a5bf..00000000000 --- a/src/examples/matlab_csv_serial/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ -px4_add_module( - MODULE examples__matlab_csv_serial - MAIN matlab_csv_serial - SRCS - matlab_csv_serial.c - DEPENDS - ) diff --git a/src/examples/matlab_csv_serial/Kconfig b/src/examples/matlab_csv_serial/Kconfig deleted file mode 100644 index 07edfafab80..00000000000 --- a/src/examples/matlab_csv_serial/Kconfig +++ /dev/null @@ -1,5 +0,0 @@ -menuconfig EXAMPLES_MATLAB_CSV_SERIAL - bool "matlab_csv_serial" - default n - ---help--- - Enable support for matlab_csv_serial diff --git a/src/examples/matlab_csv_serial/matlab_csv_serial.c b/src/examples/matlab_csv_serial/matlab_csv_serial.c deleted file mode 100644 index 701e7568c4e..00000000000 --- a/src/examples/matlab_csv_serial/matlab_csv_serial.c +++ /dev/null @@ -1,241 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2014-2015 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. - * - ****************************************************************************/ - -/** - * @file matlab_csv_serial.c - * - * Matlab CSV / ASCII format interface at 921600 baud, 8 data bits, - * 1 stop bit, no parity - * - * @author Lorenz Meier - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -__EXPORT int matlab_csv_serial_main(int argc, char *argv[]); -static bool thread_should_exit = false; /**< Daemon exit flag */ -static bool thread_running = false; /**< Daemon status flag */ -static int daemon_task; /**< Handle of daemon task / thread */ - -int matlab_csv_serial_thread_main(int argc, char *argv[]); -static void usage(const char *reason); - -static void usage(const char *reason) -{ - if (reason) { - fprintf(stderr, "%s\n", reason); - } - - fprintf(stderr, "usage: daemon {start|stop|status} [-p ]\n\n"); - exit(1); -} - -/** - * The daemon app only briefly exists to start - * the background job. The stack size assigned in the - * Makefile does only apply to this management task. - * - * The actual stack size should be set in the call - * to px4_task_spawn_cmd(). - */ -int matlab_csv_serial_main(int argc, char *argv[]) -{ - if (argc < 2) { - usage("missing command"); - } - - if (!strcmp(argv[1], "start")) { - if (thread_running) { - warnx("already running\n"); - /* this is not an error */ - exit(0); - } - - thread_should_exit = false; - daemon_task = px4_task_spawn_cmd("matlab_csv_serial", - SCHED_DEFAULT, - SCHED_PRIORITY_MAX - 5, - 2000, - matlab_csv_serial_thread_main, - (argv) ? (char *const *)&argv[2] : (char *const *)NULL); - exit(0); - } - - if (!strcmp(argv[1], "stop")) { - thread_should_exit = true; - exit(0); - } - - if (!strcmp(argv[1], "status")) { - if (thread_running) { - warnx("running"); - - } else { - warnx("stopped"); - } - - exit(0); - } - - usage("unrecognized command"); - exit(1); -} - -int matlab_csv_serial_thread_main(int argc, char *argv[]) -{ - - if (argc < 2) { - errx(1, "need a serial port name as argument"); - } - - const char *uart_name = argv[1]; - - warnx("opening port %s", uart_name); - - int serial_fd = open(uart_name, O_RDWR | O_NOCTTY); - - unsigned speed = 921600; - - if (serial_fd < 0) { - err(1, "failed to open port: %s", uart_name); - } - - /* Try to set baud rate */ - struct termios uart_config; - int termios_state; - - /* Back up the original uart configuration to restore it after exit */ - if ((termios_state = tcgetattr(serial_fd, &uart_config)) < 0) { - warnx("ERR GET CONF %s: %d\n", uart_name, termios_state); - close(serial_fd); - return -1; - } - - /* Clear ONLCR flag (which appends a CR for every LF) */ - uart_config.c_oflag &= ~ONLCR; - - /* USB serial is indicated by /dev/ttyACM0*/ - if (strcmp(uart_name, "/dev/ttyACM0") != OK && strcmp(uart_name, "/dev/ttyACM1") != OK) { - - /* Set baud rate */ - if (cfsetispeed(&uart_config, speed) < 0 || cfsetospeed(&uart_config, speed) < 0) { - warnx("ERR SET BAUD %s: %d\n", uart_name, termios_state); - close(serial_fd); - return -1; - } - - } - - if ((termios_state = tcsetattr(serial_fd, TCSANOW, &uart_config)) < 0) { - warnx("ERR SET CONF %s\n", uart_name); - close(serial_fd); - return -1; - } - - /* subscribe to vehicle status, attitude, sensors and flow*/ - struct sensor_accel_s accel0; - struct sensor_accel_s accel1; - struct sensor_gyro_s gyro0; - struct sensor_gyro_s gyro1; - - /* subscribe to parameter changes */ - orb_sub_t accel0_sub = orb_subscribe_multi(ORB_ID(sensor_accel), 0); - orb_sub_t accel1_sub = orb_subscribe_multi(ORB_ID(sensor_accel), 1); - orb_sub_t gyro0_sub = orb_subscribe_multi(ORB_ID(sensor_gyro), 0); - orb_sub_t gyro1_sub = orb_subscribe_multi(ORB_ID(sensor_gyro), 1); - - thread_running = true; - - while (!thread_should_exit) { - - /*This runs at the rate of the sensors */ - px4_pollfd_struct_t fds[] = { - { .fd = accel0_sub, .events = POLLIN } - }; - - /* wait for a sensor update, check for exit condition every 500 ms */ - int ret = px4_poll(fds, sizeof(fds) / sizeof(fds[0]), 500); - - if (ret < 0) { - /* poll error, ignore */ - - } else if (ret == 0) { - /* no return value, ignore */ - warnx("no sensor data"); - - } else { - - /* accel0 update available? */ - if (fds[0].revents & POLLIN) { - orb_copy(ORB_ID(sensor_accel), accel0_sub, &accel0); - orb_copy(ORB_ID(sensor_accel), accel1_sub, &accel1); - orb_copy(ORB_ID(sensor_gyro), gyro0_sub, &gyro0); - orb_copy(ORB_ID(sensor_gyro), gyro1_sub, &gyro1); - - // write out on accel 0, but collect for all other sensors as they have updates - dprintf(serial_fd, "%"PRId64",%d,%d,%d,%d,%d,%d\n", accel0.timestamp, (int)accel0.x, (int)accel0.y, - (int)accel0.z, - (int)accel1.x, (int)accel1.y, (int)accel1.z); - } - - } - } - - warnx("exiting"); - thread_running = false; - - fflush(stdout); - return 0; -} diff --git a/src/examples/px4_mavlink_debug/CMakeLists.txt b/src/examples/px4_mavlink_debug/CMakeLists.txt deleted file mode 100644 index 35c91a27e1f..00000000000 --- a/src/examples/px4_mavlink_debug/CMakeLists.txt +++ /dev/null @@ -1,39 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 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. -# -############################################################################ -px4_add_module( - MODULE examples__px4_mavlink_debug - MAIN px4_mavlink_debug - SRCS - px4_mavlink_debug.cpp - DEPENDS - ) diff --git a/src/examples/px4_mavlink_debug/Kconfig b/src/examples/px4_mavlink_debug/Kconfig deleted file mode 100644 index 2f299844c06..00000000000 --- a/src/examples/px4_mavlink_debug/Kconfig +++ /dev/null @@ -1,5 +0,0 @@ -menuconfig EXAMPLES_PX4_MAVLINK_DEBUG - bool "px4_mavlink_debug" - default n - ---help--- - Enable support for px4_mavlink_debug diff --git a/src/examples/px4_mavlink_debug/px4_mavlink_debug.cpp b/src/examples/px4_mavlink_debug/px4_mavlink_debug.cpp deleted file mode 100644 index 97047f07484..00000000000 --- a/src/examples/px4_mavlink_debug/px4_mavlink_debug.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2012-2015 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. - * - ****************************************************************************/ - -/** - * @file px4_mavlink_debug.cpp - * Debug application example for PX4 autopilot - * - * @author Example User - */ - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include - -extern "C" __EXPORT int px4_mavlink_debug_main(int argc, char *argv[]); - -int px4_mavlink_debug_main(int argc, char *argv[]) -{ - printf("Hello Debug!\n"); - - /* advertise named debug value */ - struct debug_key_value_s dbg_key; - strncpy(dbg_key.key, "velx", 10); - dbg_key.value = 0.0f; - orb_advert_t pub_dbg_key = orb_advertise(ORB_ID(debug_key_value), &dbg_key); - - /* advertise indexed debug value */ - struct debug_value_s dbg_ind; - dbg_ind.ind = 42; - dbg_ind.value = 0.5f; - orb_advert_t pub_dbg_ind = orb_advertise(ORB_ID(debug_value), &dbg_ind); - - /* advertise debug vect */ - struct debug_vect_s dbg_vect; - strncpy(dbg_vect.name, "vel3D", 10); - dbg_vect.x = 1.0f; - dbg_vect.y = 2.0f; - dbg_vect.z = 3.0f; - orb_advert_t pub_dbg_vect = orb_advertise(ORB_ID(debug_vect), &dbg_vect); - - /* advertise debug array */ - struct debug_array_s dbg_array; - dbg_array.id = 1; - strncpy(dbg_array.name, "dbg_array", 10); - orb_advert_t pub_dbg_array = orb_advertise(ORB_ID(debug_array), &dbg_array); - - int value_counter = 0; - - while (value_counter < 100) { - uint64_t timestamp_us = hrt_absolute_time(); - - /* send one named value */ - dbg_key.value = value_counter; - dbg_key.timestamp = timestamp_us; - orb_publish(ORB_ID(debug_key_value), pub_dbg_key, &dbg_key); - - /* send one indexed value */ - dbg_ind.value = 0.5f * value_counter; - dbg_ind.timestamp = timestamp_us; - orb_publish(ORB_ID(debug_value), pub_dbg_ind, &dbg_ind); - - /* send one vector */ - dbg_vect.x = 1.0f * value_counter; - dbg_vect.y = 2.0f * value_counter; - dbg_vect.z = 3.0f * value_counter; - dbg_vect.timestamp = timestamp_us; - orb_publish(ORB_ID(debug_vect), pub_dbg_vect, &dbg_vect); - - /* send one array */ - for (size_t i = 0; i < debug_array_s::ARRAY_SIZE; i++) { - dbg_array.data[i] = value_counter + i * 0.01f; - } - - dbg_array.timestamp = timestamp_us; - orb_publish(ORB_ID(debug_array), pub_dbg_array, &dbg_array); - - warnx("sent one more value.."); - - value_counter++; - px4_usleep(500000); - } - - return 0; -}