better support for param default values on ros and px4

This commit is contained in:
Thomas Gubler 2014-12-04 09:53:37 +01:00
parent c2e2b3d52f
commit 83d97fd1c2
3 changed files with 7 additions and 5 deletions

View File

@ -46,11 +46,11 @@
*
* @group Subscriber Example
*/
PARAM_DEFINE_INT32(SUB_INTERV, PX4_PARAM_DEFAULT_VALUE_NAME(SUB_INTERV));
PX4_PARAM_DEFINE_INT32(SUB_INTERV);
/**
* Float Demonstration Parameter in the Example
*
* @group Subscriber Example
*/
PARAM_DEFINE_FLOAT(SUB_TESTF, PX4_PARAM_DEFAULT_VALUE_NAME(SUB_TESTF));
PX4_PARAM_DEFINE_FLOAT(SUB_TESTF);

View File

@ -39,5 +39,5 @@
*/
#pragma once
#define SUB_INTERV_DEFAULT_VALUE 100
#define SUB_TESTF_DEFAULT_VALUE 3.14f
#define PARAM_SUB_INTERV_DEFAULT 100
#define PARAM_SUB_TESTF_DEFAULT 3.14f

View File

@ -39,7 +39,9 @@
#pragma once
#define PX4_PARAM_DEFAULT_VALUE_NAME(_name) _name##_DEFAULT_VALUE
#define PX4_PARAM_DEFAULT_VALUE_NAME(_name) PARAM_##_name##_DEFAULT
#define PX4_PARAM_DEFINE_INT32(_name) PARAM_DEFINE_INT32(_name, PX4_PARAM_DEFAULT_VALUE_NAME(_name))
#define PX4_PARAM_DEFINE_FLOAT(_name) PARAM_DEFINE_FLOAT(_name, PX4_PARAM_DEFAULT_VALUE_NAME(_name))
#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__))