diff --git a/boards/airmind/mindpx-v2/default.cmake b/boards/airmind/mindpx-v2/default.cmake index ad57ff79dc..28c056cbb4 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 b385d82d9e..d2e17ce7ee 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 5a9cf851ef..7521127784 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 b8429b08dc..6bdcb11550 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 20bbb5f213..60b5644653 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 c046329e51..6501a365bd 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 f30ff7603c..a2654160fc 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 4d5fb4db86..1691e0606d 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 35e9cd3147..612f52b859 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 e113030b37..505edbefb4 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 4bf30b86da..532767854d 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 1044590806..3393ba784a 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 2c7a18656d..d5551363bb 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 8fde9b97ad..50500658e4 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 c72f4f687e..9ea14e5c40 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 6f5ddb9b57..d74323832c 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 33ff1283e6..6e64151e5c 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 c09f373e0b..06257d1db4 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 aee8fd655a..bc96541d60 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 0b2e597d0e..5879d5a86b 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 95b4aff0dc..ae319b64f9 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 9a4193cfd0..648d063eec 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 c72e983288..0000000000 --- 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 77bfcb8d3e..0000000000 --- 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 - */ - -#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(rc_channels_callback_function, _p_sub_interv.get()); - - /* No callback */ - _sub_rc_chan = _n.subscribe(500); - - /* Class method */ - _n.subscribe(&SubscriberExample::rc_channels_callback, this, 1000); - - /* Another class method */ - _n.subscribe(&SubscriberExample::vehicle_attitude_callback, this, 1000); - - /* Yet antoher class method */ - _n.subscribe(&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 fec8a76efc..0000000000 --- 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 - */ -#include - -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 *_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 798c741637..0000000000 --- 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 - */ -#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 6d4202561c..0000000000 --- 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 - */ - -#include -#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 f6f1d6ba0c..0000000000 --- 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 - */ -#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 5ffa3ed180..0000000000 --- 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 - */ -#include -#include -#include - -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; -}