aboutsummaryrefslogtreecommitdiff
path: root/src/platforms/px4_defines.h
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-12-11 15:33:32 +0100
committerThomas Gubler <thomasgubler@gmail.com>2014-12-11 15:33:32 +0100
commit998646f03b229ae86bd6e57ff0bd15dd1763c342 (patch)
tree340fa4c7d15b9a92158bd142a9e53a53d7b178cf /src/platforms/px4_defines.h
parentc68c277c94cacd2a64b634dd9c45ace2a04c2911 (diff)
downloadpx4-firmware-998646f03b229ae86bd6e57ff0bd15dd1763c342.tar.gz
px4-firmware-998646f03b229ae86bd6e57ff0bd15dd1763c342.tar.bz2
px4-firmware-998646f03b229ae86bd6e57ff0bd15dd1763c342.zip
add base class and template subscriber class as well to improve interface to get last msg value
Diffstat (limited to 'src/platforms/px4_defines.h')
-rw-r--r--src/platforms/px4_defines.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/platforms/px4_defines.h b/src/platforms/px4_defines.h
index fa3ef216a..9bb190380 100644
--- a/src/platforms/px4_defines.h
+++ b/src/platforms/px4_defines.h
@@ -93,9 +93,6 @@ static inline px4_param_t PX4_ROS_PARAM_SET(const char *name, float value)
/* Get value of parameter */
#define PX4_PARAM_GET(_handle, _destpt) ros::param::get(_handle, *_destpt)
-/* Get a subscriber class type based on the topic name */
-#define PX4_SUBSCRIBER_T(_name) SubscriberROS<PX4_TOPIC_T(_name)>
-
#else
/*
* Building for NuttX
@@ -134,9 +131,6 @@ typedef param_t px4_param_t;
/* Get value of parameter */
#define PX4_PARAM_GET(_handle, _destpt) param_get(_handle, _destpt)
-/* Get a subscriber class type based on the topic name */
-#define PX4_SUBSCRIBER_T(_name) SubscriberUORB<PX4_TOPIC_T(_name)>
-
/* XXX this is a hack to resolve conflicts with NuttX headers */
#define isspace(c) \
((c) == ' ' || (c) == '\t' || (c) == '\n' || \
@@ -150,6 +144,9 @@ typedef param_t px4_param_t;
#define PX4_GET_SUBSCRIBE(_1, _2, _3, _4, _5, NAME, ...) NAME
#define PX4_SUBSCRIBE(...) PX4_GET_SUBSCRIBE(__VA_ARGS__, PX4_SUBSCRIBE_CBMETH, PX4_SUBSCRIBE_CBFUNC, PX4_SUBSCRIBE_NOCB)(__VA_ARGS__)
+/* Get a subscriber class type based on the topic name */
+#define PX4_SUBSCRIBER(_name) Subscriber<PX4_TOPIC_T(_name)>
+
/* shortcut for advertising topics */
#define PX4_ADVERTISE(_nodehandle, _name) _nodehandle.advertise<PX4_TOPIC_T(_name)>(PX4_TOPIC(_name))