46 #ifndef ROBOT_ACTIVITY_RESOURCE_MANAGED_SUBSCRIBER_H 47 #define ROBOT_ACTIVITY_RESOURCE_MANAGED_SUBSCRIBER_H 124 template <
class Message>
144 template<
class Message>
146 const std::string& topic, uint32_t queue_size,
151 ROS_DEBUG(
"makeLazyAcquirer MessageCallback<Message>& callback form exec");
155 return nh->subscribe<Message>(
180 template<
class M,
class T>
182 const std::string& topic, uint32_t queue_size,
void(T::*fp)(M), T* obj,
185 ROS_DEBUG(
"makeLazyAcquirer void(T::*fp)(M), T* obj, form exec");
206 template<
class M,
class T>
208 const std::string& topic, uint32_t queue_size,
void(T::*fp)(M)
const, T* obj,
211 ROS_DEBUG(
"makeLazyAcquirer void(T::*fp)(M) const, T* obj, form exec");
233 template<
class M,
class T>
235 const std::string& topic, uint32_t queue_size,
240 <<
"void(T::*fp)(const boost::shared_ptr<M const>&), " 241 <<
"T* obj, form exec");
263 template<
class M,
class T>
265 const std::string& topic, uint32_t queue_size,
270 <<
"void(T::*fp)(const boost::shared_ptr<M const>&) const, " 271 <<
"T* obj, form exec");
295 template<
class M,
class T>
297 const std::string& topic, uint32_t queue_size,
302 <<
"void(T::*fp)(M), " 303 <<
"const boost::shared_ptr<T>& obj, form exec");
327 template<
class M,
class T>
329 const std::string& topic, uint32_t queue_size,
334 <<
"void(T::*fp)(M) const, " 335 <<
"const boost::shared_ptr<T>& obj, form exec");
359 template<
class M,
class T>
361 const std::string& topic, uint32_t queue_size,
367 <<
"void(T::*fp)(const boost::shared_ptr<M const>&), " 368 <<
"const boost::shared_ptr<T>& obj, form exec");
392 template<
class M,
class T>
394 const std::string& topic, uint32_t queue_size,
400 <<
"void(T::*fp)(const boost::shared_ptr<M const>&) const, " 401 <<
"const boost::shared_ptr<T>& obj, form exec");
423 const std::string& topic, uint32_t queue_size,
void(*fp)(M),
427 <<
"void(*fp)(M) form exec");
454 <<
"void(*fp)(const boost::shared_ptr<M const>&) form exec");
495 template<
class Message>
498 return [
this, &callback](Message message)
511 #endif // ROBOT_ACTIVITY_RESOURCE_MANAGED_SUBSCRIBER_H void shutdown()
Shutdowns the ROS subscriber.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(*fp)(M), const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(T::*fp)(const boost::shared_ptr< M const > &), const boost::shared_ptr< T > &obj, const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
std::atomic< bool > paused_
Atomic flag specifing whether the resource is paused or not.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(T::*fp)(M) const, const boost::shared_ptr< T > &obj, const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
boost::function< void(Message)> MessageCallback
Typedef for ROS subscriber callbacks.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), const boost::shared_ptr< T > &obj, const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
std::function< ros::Subscriber(const ros::NodeHandlePtr &)> LazyAcquirer
MessageCallback< Message > wrapMessageCallback(const MessageCallback< Message > &callback) const
Wraps the message callback.
Wrapper around ROS resources, such as ros::Subscriber and ros::ServiceServer.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(T::*fp)(const boost::shared_ptr< M const > &) const, T *obj, const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
void release()
Releases the resource if it's already acquired. shutdown() method in case of ros::Subscriber and ros:...
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, const MessageCallback< Message > &callback, const ros::VoidConstPtr &tracked_object=ros::VoidConstPtr(), const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(T::*fp)(M) const, T *obj, const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(*fp)(const boost::shared_ptr< M const > &), const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
#define ROS_DEBUG_STREAM(args)
void subscribe(const ros::NodeHandlePtr &node_handle)
Subscribes to a ROS topic given a node handle.
Implementation of Managed class for ros::Subscriber.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(T::*fp)(const boost::shared_ptr< M const > &), T *obj, const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(T::*fp)(const boost::shared_ptr< M const > &) const, const boost::shared_ptr< T > &obj, const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
void acquire(const ros::NodeHandlePtr &node_handle)
Acquires the resource if it's not already acquired.
LazyAcquirer makeLazyAcquirer(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const ros::TransportHints &transport_hints=ros::TransportHints()) const
Creates a function that when called subscribes to a ROS topic.
Managed<Derived,R> class implements a base class which manages ROS resources, such as ros::Subscriber...