mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 05:03:34 +08:00
WIP, towards more px4 compatibility, first macros
This commit is contained in:
@@ -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/Subscription.hpp>
|
||||
#endif
|
||||
|
||||
namespace px4
|
||||
@@ -48,14 +52,23 @@ namespace px4
|
||||
class Subscriber
|
||||
{
|
||||
public:
|
||||
Subscriber(ros::Subscriber ros_sub) : _ros_sub(ros_sub)
|
||||
Subscriber(ros::Subscriber ros_sub) :
|
||||
_ros_sub(ros_sub)
|
||||
{}
|
||||
~Subscriber() {};
|
||||
private:
|
||||
ros::Subscriber _ros_sub;
|
||||
};
|
||||
#else
|
||||
class Subscriber
|
||||
template<typename M>
|
||||
class Subscriber :
|
||||
public uORB::Subscription<M>
|
||||
public:
|
||||
Subscriber(List<SubscriptionBase *> * list,
|
||||
const struct orb_metadata *meta, unsigned interval) :
|
||||
uORB::Subsciption(list, meta, interval)
|
||||
{}
|
||||
~Subscriber() {};
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user