diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-24 15:58:06 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-11-24 15:58:06 +0100 |
commit | 3f36d30a3413cd70096e953a2c9ea0ded65bf24e (patch) | |
tree | 4a1569cecb1cfe0507fed5334523ea3d57cf396a /src/platforms/px4_nodehandle.h | |
parent | 1e36de61579dd35fe46a069520b7c8970c3cb7cd (diff) | |
download | px4-firmware-3f36d30a3413cd70096e953a2c9ea0ded65bf24e.tar.gz px4-firmware-3f36d30a3413cd70096e953a2c9ea0ded65bf24e.tar.bz2 px4-firmware-3f36d30a3413cd70096e953a2c9ea0ded65bf24e.zip |
wrapped subscriber
Diffstat (limited to 'src/platforms/px4_nodehandle.h')
-rw-r--r-- | src/platforms/px4_nodehandle.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/platforms/px4_nodehandle.h b/src/platforms/px4_nodehandle.h index d278828b7..df198615c 100644 --- a/src/platforms/px4_nodehandle.h +++ b/src/platforms/px4_nodehandle.h @@ -36,11 +36,27 @@ * * PX4 Middleware Wrapper Node Handle */ +#pragma once +#include <px4_subscriber.h> +#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) +#include "ros/ros.h" +#endif namespace px4 { +#if defined(__linux) || (defined(__APPLE__) && defined(__MACH__)) +class NodeHandle : private ros::NodeHandle +{ +public: + template<class M> + Subscriber* subscribe(const char *topic, void(*fp)(M)) { + ros::NodeHandle::subscribe("rc_channels", 1000, fp); + return new Subscriber(); + } +}; +#else class NodeHandle { - }; +#endif } |