diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-25 09:56:18 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-25 09:56:18 +0100 |
commit | 978013bbb8d67e295d92a54e16f7728013722e92 (patch) | |
tree | ac4774fb6b3ea1563408acd7f1d221cfe164cb36 /src/platforms/px4_publisher.h | |
parent | 0a3492fc328280422df9472d3d8a586d92242feb (diff) | |
download | px4-firmware-978013bbb8d67e295d92a54e16f7728013722e92.tar.gz px4-firmware-978013bbb8d67e295d92a54e16f7728013722e92.tar.bz2 px4-firmware-978013bbb8d67e295d92a54e16f7728013722e92.zip |
px4 wrapper for ros publisher
Diffstat (limited to 'src/platforms/px4_publisher.h')
-rw-r--r-- | src/platforms/px4_publisher.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/platforms/px4_publisher.h b/src/platforms/px4_publisher.h index 78d2a744b..799525190 100644 --- a/src/platforms/px4_publisher.h +++ b/src/platforms/px4_publisher.h @@ -37,11 +37,27 @@ * PX4 Middleware Wrapper Node Handle */ #pragma once +#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) +#include "ros/ros.h" +#endif namespace px4 { +#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) +class Publisher +{ +private: + ros::Publisher _ros_pub; +public: + Publisher(ros::Publisher ros_pub) : _ros_pub(ros_pub) + {} + ~Publisher() {}; + template<typename M> + int publish(const M &msg) { _ros_pub.publish(msg); return 0; } +}; +#else class Publisher { - }; +#endif } |