subscriber example: improve init

This commit is contained in:
Thomas Gubler 2014-12-10 16:25:10 +01:00
parent 8ae1c9763d
commit da4cfad3c2
2 changed files with 4 additions and 6 deletions

View File

@ -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);

View File

@ -32,7 +32,7 @@
****************************************************************************/
/**
* @file subscriber.h
* @file subscriber_example.h
* Example subscriber for ros and px4
*
* @author Thomas Gubler <thomasgubler@gmail.com>