diff --git a/boards/airmind/mindpx-v2/default.cmake b/boards/airmind/mindpx-v2/default.cmake index ad57ff79dc0a38580f33bae46d4aca214e506cf0..28c056cbb4a39a64bdb52d97924bf980ca626275 100644 --- a/boards/airmind/mindpx-v2/default.cmake +++ b/boards/airmind/mindpx-v2/default.cmake @@ -109,7 +109,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/atmel/same70xplained/default.cmake b/boards/atmel/same70xplained/default.cmake index b385d82d9ee298b0064fb696b5702fa5c9e307e5..d2e17ce7eee0fb2030ee1980de674319edfe1fa5 100644 --- a/boards/atmel/same70xplained/default.cmake +++ b/boards/atmel/same70xplained/default.cmake @@ -109,7 +109,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/auav/x21/default.cmake b/boards/auav/x21/default.cmake index 5a9cf851ef67a58959d7c7dc1500b616e4150ffa..75211277844bd8ebe1eabb76330da2913766072f 100644 --- a/boards/auav/x21/default.cmake +++ b/boards/auav/x21/default.cmake @@ -114,7 +114,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/av/x-v1/default.cmake b/boards/av/x-v1/default.cmake index b8429b08dc30ab00fefbc6cd8447621b33a68f7a..6bdcb115501741bcd4c8ff1b305f27e4859c6052 100644 --- a/boards/av/x-v1/default.cmake +++ b/boards/av/x-v1/default.cmake @@ -114,7 +114,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/gumstix/aerocore2/default.cmake b/boards/gumstix/aerocore2/default.cmake index 20bbb5f213c0457f8d62dc7a5ef6697a50de32db..60b5644653766ae5d369ea0528ddc0314cdd834f 100644 --- a/boards/gumstix/aerocore2/default.cmake +++ b/boards/gumstix/aerocore2/default.cmake @@ -110,7 +110,6 @@ px4_add_board( #px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app #rover_steering_control # Rover example app #segway - #subscriber #uuv_example_app ) diff --git a/boards/intel/aerofc-v1/default.cmake b/boards/intel/aerofc-v1/default.cmake index c046329e5152e6e31749f087b1ff7f43c35d6a0c..6501a365bd2d8944043e32691011ea58b346b201 100644 --- a/boards/intel/aerofc-v1/default.cmake +++ b/boards/intel/aerofc-v1/default.cmake @@ -92,7 +92,6 @@ px4_add_board( #px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app #rover_steering_control # Rover example app #segway - #subscriber #uuv_example_app ) diff --git a/boards/intel/aerofc-v1/rtps.cmake b/boards/intel/aerofc-v1/rtps.cmake index f30ff7603c6fd3b0a412e24de3fdfe182e11214a..a2654160fc2f1f8cd04f9b77e8635635693b2b89 100644 --- a/boards/intel/aerofc-v1/rtps.cmake +++ b/boards/intel/aerofc-v1/rtps.cmake @@ -95,7 +95,6 @@ px4_add_board( #px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app #rover_steering_control # Rover example app #segway - #subscriber #uuv_example_app ) diff --git a/boards/nxp/fmuk66-v3/default.cmake b/boards/nxp/fmuk66-v3/default.cmake index 4d5fb4db867f9fd746497ccbcf449f20d17bf58e..1691e0606d9bc6776f07676f6b910957cee75186 100644 --- a/boards/nxp/fmuk66-v3/default.cmake +++ b/boards/nxp/fmuk66-v3/default.cmake @@ -110,7 +110,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/omnibus/f4sd/default.cmake b/boards/omnibus/f4sd/default.cmake index 35e9cd31475037843185a7325bb5368a26eda055..612f52b8592b4f2715d07fd9f5323da43bc9fc42 100644 --- a/boards/omnibus/f4sd/default.cmake +++ b/boards/omnibus/f4sd/default.cmake @@ -104,7 +104,6 @@ px4_add_board( #px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app #rover_steering_control # Rover example app #segway - #subscriber #uuv_example_app ) diff --git a/boards/px4/fmu-v3/default.cmake b/boards/px4/fmu-v3/default.cmake index e113030b37152b5fe0b879a27d14481e75d0e8bf..505edbefb45aea081e7a45be9778f4b12d2e924d 100644 --- a/boards/px4/fmu-v3/default.cmake +++ b/boards/px4/fmu-v3/default.cmake @@ -122,7 +122,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/px4/fmu-v3/rtps.cmake b/boards/px4/fmu-v3/rtps.cmake index 4bf30b86da3aad53498e27c2b7ae72a01744d5c0..532767854d91563a79ef0cec0a100d4b518ff90a 100644 --- a/boards/px4/fmu-v3/rtps.cmake +++ b/boards/px4/fmu-v3/rtps.cmake @@ -123,7 +123,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/px4/fmu-v3/stackcheck.cmake b/boards/px4/fmu-v3/stackcheck.cmake index 1044590806833a566127f455c75524ee7a9eaf6e..3393ba784aa4cfeb964f92f0dbccbcd47d869513 100644 --- a/boards/px4/fmu-v3/stackcheck.cmake +++ b/boards/px4/fmu-v3/stackcheck.cmake @@ -122,7 +122,6 @@ px4_add_board( #px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app #rover_steering_control # Rover example app #segway - #subscriber #uuv_example_app ) diff --git a/boards/px4/fmu-v4/default.cmake b/boards/px4/fmu-v4/default.cmake index 2c7a18656d744f8ebce903c372b947dbcec6a8bb..d5551363bb666144d0cde00352999db4c6be0024 100644 --- a/boards/px4/fmu-v4/default.cmake +++ b/boards/px4/fmu-v4/default.cmake @@ -107,7 +107,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/px4/fmu-v4/rtps.cmake b/boards/px4/fmu-v4/rtps.cmake index 8fde9b97ad2a456b40caf2ca031d99671933a12b..50500658e4c50e1c251c127128ec25f3f81a3cd8 100644 --- a/boards/px4/fmu-v4/rtps.cmake +++ b/boards/px4/fmu-v4/rtps.cmake @@ -109,7 +109,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/px4/fmu-v4/stackcheck.cmake b/boards/px4/fmu-v4/stackcheck.cmake index c72f4f687eb7f0bcbe80922311abdba36596e5c8..9ea14e5c40ce696c6058ce3bca99173e5811a299 100644 --- a/boards/px4/fmu-v4/stackcheck.cmake +++ b/boards/px4/fmu-v4/stackcheck.cmake @@ -107,7 +107,6 @@ px4_add_board( #px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app #rover_steering_control # Rover example app #segway - #subscriber #uuv_example_app ) diff --git a/boards/px4/fmu-v4pro/default.cmake b/boards/px4/fmu-v4pro/default.cmake index 6f5ddb9b573d081f63bb0a0a098d1bc6c654652b..d74323832c3f70905cc89541f4729c75cd4e4cfc 100644 --- a/boards/px4/fmu-v4pro/default.cmake +++ b/boards/px4/fmu-v4pro/default.cmake @@ -121,7 +121,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/px4/fmu-v4pro/rtps.cmake b/boards/px4/fmu-v4pro/rtps.cmake index 33ff1283e6f600418cca67a722f7423bcb1384cc..6e64151e5ce28a54ce884141df9ac361a5b8a37c 100644 --- a/boards/px4/fmu-v4pro/rtps.cmake +++ b/boards/px4/fmu-v4pro/rtps.cmake @@ -122,7 +122,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/px4/fmu-v5/default.cmake b/boards/px4/fmu-v5/default.cmake index c09f373e0bbc3d13c4bb19d826e2a2b981e1ffac..06257d1db4af3c193eb5ce9c343c037f1230ef4c 100644 --- a/boards/px4/fmu-v5/default.cmake +++ b/boards/px4/fmu-v5/default.cmake @@ -121,7 +121,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/px4/fmu-v5/rtps.cmake b/boards/px4/fmu-v5/rtps.cmake index aee8fd655a7ec46a0bccf0f7298dbbaa64c83f42..bc96541d60708ba653e4e62299c25961533158bf 100644 --- a/boards/px4/fmu-v5/rtps.cmake +++ b/boards/px4/fmu-v5/rtps.cmake @@ -123,7 +123,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/px4/fmu-v5/stackcheck.cmake b/boards/px4/fmu-v5/stackcheck.cmake index 0b2e597d0e4931334263d21db23745d0122227b6..5879d5a86b99bfdf8f3c8b8a2adedc757ce19f10 100644 --- a/boards/px4/fmu-v5/stackcheck.cmake +++ b/boards/px4/fmu-v5/stackcheck.cmake @@ -122,7 +122,6 @@ px4_add_board( #px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app #rover_steering_control # Rover example app #segway - #subscriber #uuv_example_app ) diff --git a/boards/stm/32f4discovery/default.cmake b/boards/stm/32f4discovery/default.cmake index 95b4aff0dce1374d8da0a5f78f7467f713619ad8..ae319b64f9de546f21dbf0ba4c4fd99cca1e60a0 100644 --- a/boards/stm/32f4discovery/default.cmake +++ b/boards/stm/32f4discovery/default.cmake @@ -99,7 +99,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/boards/stm/nucleo-F767ZI/default.cmake b/boards/stm/nucleo-F767ZI/default.cmake index 9a4193cfd0c24c3ae4470e571ef5c0159a10bb6a..648d063eec069926c13f818eb7fbb2f3e9fac7db 100644 --- a/boards/stm/nucleo-F767ZI/default.cmake +++ b/boards/stm/nucleo-F767ZI/default.cmake @@ -108,7 +108,6 @@ px4_add_board( px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app rover_steering_control # Rover example app segway - #subscriber uuv_example_app ) diff --git a/src/examples/subscriber/CMakeLists.txt b/src/examples/subscriber/CMakeLists.txt deleted file mode 100644 index c72e983288da183efb6b90a3475f1780cf9a693a..0000000000000000000000000000000000000000 --- a/src/examples/subscriber/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__subscriber - MAIN subscriber - STACK_MAIN 2400 - SRCS - subscriber_main.cpp - subscriber_start_nuttx.cpp - subscriber_example.cpp - subscriber_params.c - DEPENDS - ) diff --git a/src/examples/subscriber/subscriber_example.cpp b/src/examples/subscriber/subscriber_example.cpp deleted file mode 100644 index 77bfcb8d3e6b293b0d389d529710dede4cb7369c..0000000000000000000000000000000000000000 --- a/src/examples/subscriber/subscriber_example.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014 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 subscriber_example.cpp - * Example subscriber for ros and px4 - * - * @author Thomas Gubler <thomasgubler@gmail.com> - */ - -#include "subscriber_params.h" -#include "subscriber_example.h" - -using namespace px4; - -void rc_channels_callback_function(const px4_rc_channels &msg) -{ - PX4_INFO("I heard: [%" PRIu64 "]", msg.data().timestamp_last_valid); -} - -SubscriberExample::SubscriberExample() : - _n(_appState), - _p_sub_interv("SUB_INTERV", PARAM_SUB_INTERV_DEFAULT), - _p_test_float("SUB_TESTF", PARAM_SUB_TESTF_DEFAULT) -{ - /* Read the parameter back as example */ - _p_sub_interv.update(); - _p_test_float.update(); - PX4_INFO("Param SUB_INTERV = %d", _p_sub_interv.get()); - PX4_INFO("Param SUB_TESTF = %.3f", (double)_p_test_float.get()); - - /* Do some subscriptions */ - /* Function */ - _n.subscribe<px4_rc_channels>(rc_channels_callback_function, _p_sub_interv.get()); - - /* No callback */ - _sub_rc_chan = _n.subscribe<px4_rc_channels>(500); - - /* Class method */ - _n.subscribe<px4_rc_channels>(&SubscriberExample::rc_channels_callback, this, 1000); - - /* Another class method */ - _n.subscribe<px4_vehicle_attitude>(&SubscriberExample::vehicle_attitude_callback, this, 1000); - - /* Yet antoher class method */ - _n.subscribe<px4_parameter_update>(&SubscriberExample::parameter_update_callback, this, 1000); - - PX4_INFO("subscribed"); -} - -/** - * This tutorial demonstrates simple receipt of messages over the PX4 middleware system. - * Also the current value of the _sub_rc_chan subscription is printed - */ -void SubscriberExample::rc_channels_callback(const px4_rc_channels &msg) -{ - PX4_INFO("rc_channels_callback (method): [%" PRIu64 "]", - msg.data().timestamp_last_valid); - PX4_INFO("rc_channels_callback (method): value of _sub_rc_chan: [%" PRIu64 "]", - _sub_rc_chan->data().timestamp_last_valid); -} - -void SubscriberExample::vehicle_attitude_callback(const px4_vehicle_attitude &msg) -{ - PX4_INFO("vehicle_attitude_callback (method): [%" PRIu64 "]", - msg.data().timestamp); -} - -void SubscriberExample::parameter_update_callback(const px4_parameter_update &msg) -{ - PX4_INFO("parameter_update_callback (method): [%" PRIu64 "]", - msg.data().timestamp); - _p_sub_interv.update(); - PX4_INFO("Param SUB_INTERV = %d", _p_sub_interv.get()); - _p_test_float.update(); - PX4_INFO("Param SUB_TESTF = %.3f", (double)_p_test_float.get()); -} diff --git a/src/examples/subscriber/subscriber_example.h b/src/examples/subscriber/subscriber_example.h deleted file mode 100644 index fec8a76efc0890310809682111d84a9f488e3c87..0000000000000000000000000000000000000000 --- a/src/examples/subscriber/subscriber_example.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014 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 subscriber_example.h - * Example subscriber for ros and px4 - * - * @author Thomas Gubler <thomasgubler@gmail.com> - */ -#include <px4.h> - -using namespace px4; - -void rc_channels_callback_function(const px4_rc_channels &msg); - -class SubscriberExample -{ -public: - SubscriberExample(); - - ~SubscriberExample() {} - - void spin() {_n.spin();} - -protected: - px4::NodeHandle _n; - px4::ParameterInt _p_sub_interv; - px4::ParameterFloat _p_test_float; - px4::Subscriber<px4_rc_channels> *_sub_rc_chan; - - AppState _appState; - - void rc_channels_callback(const px4_rc_channels &msg); - void vehicle_attitude_callback(const px4_vehicle_attitude &msg); - void parameter_update_callback(const px4_parameter_update &msg); - -}; diff --git a/src/examples/subscriber/subscriber_main.cpp b/src/examples/subscriber/subscriber_main.cpp deleted file mode 100644 index 798c741637a44908175ada267d0af077949c18b7..0000000000000000000000000000000000000000 --- a/src/examples/subscriber/subscriber_main.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014 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 subscriber_main.cpp - * Example subscriber for ros and px4 - * - * @author Thomas Gubler <thomasgubler@gmail.com> - */ -#include "subscriber_example.h" -bool thread_running = false; /**< Deamon status flag */ - -int main(int argc, char **argv) -{ - px4::init(argc, argv, "subscriber"); - - PX4_INFO("starting"); - SubscriberExample s; - thread_running = true; - s.spin(); - - PX4_INFO("exiting."); - thread_running = false; - return 0; -} diff --git a/src/examples/subscriber/subscriber_params.c b/src/examples/subscriber/subscriber_params.c deleted file mode 100644 index 6d4202561c5e260b570ff893cbbc14a1988d5c89..0000000000000000000000000000000000000000 --- a/src/examples/subscriber/subscriber_params.c +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013, 2014 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 subscriber_params.c - * Parameters for the subscriber example - * - * @author Thomas Gubler <thomasgubler@gmail.com> - */ - -#include <px4_defines.h> -#include "subscriber_params.h" - -/** - * Interval of one subscriber in the example in ms - * - * @unit ms - * @group Subscriber Example - */ -PX4_PARAM_DEFINE_INT32(SUB_INTERV); - -/** - * Float Demonstration Parameter in the Example - * - * @group Subscriber Example - */ -PX4_PARAM_DEFINE_FLOAT(SUB_TESTF); diff --git a/src/examples/subscriber/subscriber_params.h b/src/examples/subscriber/subscriber_params.h deleted file mode 100644 index f6f1d6ba0cf6e728f39ff0972392bf682f31ad0e..0000000000000000000000000000000000000000 --- a/src/examples/subscriber/subscriber_params.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - * - * Copyright (c) 2013, 2014 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 subscriber_params.h - * Default parameters for the subscriber example - * - * @author Thomas Gubler <thomasgubler@gmail.com> - */ -#pragma once - -#define PARAM_SUB_INTERV_DEFAULT 100 -#define PARAM_SUB_TESTF_DEFAULT 3.14f diff --git a/src/examples/subscriber/subscriber_start_nuttx.cpp b/src/examples/subscriber/subscriber_start_nuttx.cpp deleted file mode 100644 index 5ffa3ed1800ffedc18dff7a61ce73d36c451b68a..0000000000000000000000000000000000000000 --- a/src/examples/subscriber/subscriber_start_nuttx.cpp +++ /dev/null @@ -1,98 +0,0 @@ -/**************************************************************************** - * - * Copyright (C) 2014 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 subscriber_start_nuttx.cpp - * - * @author Thomas Gubler <thomasgubler@gmail.com> - */ -#include <string.h> -#include <cstdlib> -#include <systemlib/err.h> - -extern bool thread_running; -int daemon_task; /**< Handle of deamon task / thread */ -namespace px4 -{ -bool task_should_exit = false; -} -using namespace px4; - -extern int main(int argc, char **argv); - -extern "C" __EXPORT int subscriber_main(int argc, char *argv[]); -int subscriber_main(int argc, char *argv[]) -{ - if (argc < 2) { - errx(1, "usage: subscriber {start|stop|status}"); - } - - if (!strcmp(argv[1], "start")) { - - if (thread_running) { - warnx("already running"); - /* this is not an error */ - exit(0); - } - - task_should_exit = false; - - daemon_task = px4_task_spawn_cmd("subscriber", - SCHED_DEFAULT, - SCHED_PRIORITY_MAX - 5, - 2000, - main, - (argv) ? (char *const *)&argv[2] : (char *const *)nullptr); - - exit(0); - } - - if (!strcmp(argv[1], "stop")) { - task_should_exit = true; - exit(0); - } - - if (!strcmp(argv[1], "status")) { - if (thread_running) { - warnx("is running"); - - } else { - warnx("not started"); - } - - exit(0); - } - - warnx("unrecognized command"); - return 1; -}