From 3f36d30a3413cd70096e953a2c9ea0ded65bf24e Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Mon, 24 Nov 2014 15:58:06 +0100 Subject: wrapped subscriber --- src/platforms/px4_nodehandle.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/platforms/px4_nodehandle.h') 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 +#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 + Subscriber* subscribe(const char *topic, void(*fp)(M)) { + ros::NodeHandle::subscribe("rc_channels", 1000, fp); + return new Subscriber(); + } +}; +#else class NodeHandle { - }; +#endif } -- cgit v1.2.3