diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-10 16:25:10 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-12-10 16:25:10 +0100 |
commit | da4cfad3c2dc14f17ccf0e9a8ce41309b76964e4 (patch) | |
tree | 3098309cb222c38b01dadc59536f0fa04056ce5a /src | |
parent | 8ae1c9763d649470ae7c55e35507509dbb2612ff (diff) | |
download | px4-firmware-da4cfad3c2dc14f17ccf0e9a8ce41309b76964e4.tar.gz px4-firmware-da4cfad3c2dc14f17ccf0e9a8ce41309b76964e4.tar.bz2 px4-firmware-da4cfad3c2dc14f17ccf0e9a8ce41309b76964e4.zip |
subscriber example: improve init
Diffstat (limited to 'src')
-rw-r--r-- | src/examples/subscriber/subscriber_example.cpp | 8 | ||||
-rw-r--r-- | src/examples/subscriber/subscriber_example.h | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/examples/subscriber/subscriber_example.cpp b/src/examples/subscriber/subscriber_example.cpp index cddab1035..e6d63cab3 100644 --- a/src/examples/subscriber/subscriber_example.cpp +++ b/src/examples/subscriber/subscriber_example.cpp @@ -32,7 +32,7 @@ ****************************************************************************/ /** - * @file subscriber.cpp + * @file subscriber_example.cpp * Example subscriber for ros and px4 * * @author Thomas Gubler <thomasgubler@gmail.com> @@ -49,13 +49,11 @@ void rc_channels_callback_function(const PX4_TOPIC_T(rc_channels) &msg) { SubscriberExample::SubscriberExample() : _n(), + _p_sub_interv(PX4_PARAM_INIT(SUB_INTERV)), _sub_interval(0), + _p_test_float(PX4_PARAM_INIT(SUB_TESTF)), _test_float(0.0f) { - /* Define parameters */ - _p_sub_interv = PX4_PARAM_INIT(SUB_INTERV); - _p_test_float = PX4_PARAM_INIT(SUB_TESTF); - /* Read the parameter back as example */ PX4_PARAM_GET(_p_sub_interv, &_sub_interval); PX4_INFO("Param SUB_INTERV = %d", _sub_interval); diff --git a/src/examples/subscriber/subscriber_example.h b/src/examples/subscriber/subscriber_example.h index 4bdc15c2d..b52f89ba8 100644 --- a/src/examples/subscriber/subscriber_example.h +++ b/src/examples/subscriber/subscriber_example.h @@ -32,7 +32,7 @@ ****************************************************************************/ /** - * @file subscriber.h + * @file subscriber_example.h * Example subscriber for ros and px4 * * @author Thomas Gubler <thomasgubler@gmail.com> |