aboutsummaryrefslogtreecommitdiff
path: root/src/platforms/px4_publisher.h
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2014-11-25 11:50:35 +0100
committerThomas Gubler <thomasgubler@gmail.com>2014-11-25 11:50:35 +0100
commit55cf2fc61c7b90725cd960f9c7d72737024f1cfc (patch)
treedca32b803a55a4f2154c8fc08d5b6bcfb035c8b7 /src/platforms/px4_publisher.h
parentc167df90380fdd99d1b56024c4de104a3f0a2f85 (diff)
downloadpx4-firmware-55cf2fc61c7b90725cd960f9c7d72737024f1cfc.tar.gz
px4-firmware-55cf2fc61c7b90725cd960f9c7d72737024f1cfc.tar.bz2
px4-firmware-55cf2fc61c7b90725cd960f9c7d72737024f1cfc.zip
WIP, towards more px4 compatibility, first macros
Diffstat (limited to 'src/platforms/px4_publisher.h')
-rw-r--r--src/platforms/px4_publisher.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/platforms/px4_publisher.h b/src/platforms/px4_publisher.h
index 72f69a5af..53e63b695 100644
--- a/src/platforms/px4_publisher.h
+++ b/src/platforms/px4_publisher.h
@@ -38,7 +38,11 @@
*/
#pragma once
#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__))
+/* includes when building for ros */
#include "ros/ros.h"
+#else
+/* includes when building for NuttX */
+#include <uORB/Publication.hpp>
#endif
namespace px4
@@ -56,7 +60,15 @@ private:
ros::Publisher _ros_pub;
};
#else
-class Publisher
+template<typename M>
+class Publisher :
+ public uORB::Publication<M>
+public:
+ Publisher(List<SubscriptionBase *> * list,
+ const struct orb_metadata *meta, unsigned interval) :
+ uORB::Publication(list, meta)
+ {}
+ ~Publisher() {};
{
};
#endif