TypedPublisher.h
Go to the documentation of this file.
00001 #ifndef CONVENIENCE_ROS_FUNCTIONS_TYPEDSUBSCRIBER_H
00002 #define CONVENIENCE_ROS_FUNCTIONS_TYPEDSUBSCRIBER_H
00003 
00004 #include <ros/ros.h>
00005 #include <baselib_binding/Thread.h>
00006 
00007 namespace convenience_ros_functions {
00008 
00015 template<class MessageType>
00016 class TypedPublisher {
00017 
00018     public:
00019     TypedPublisher(ros::NodeHandle& _node):
00020         node(_node),
00021         running(false)
00022     {}
00023 
00024     ~TypedPublisher(){}
00025 
00026     void start(const std::string& _topic, int queue_size=100);
00027 
00028     void stop();
00029 
00030     void publish(MessageType& m);
00031 
00032     private:
00033     
00034     typedef baselib_binding::mutex mutex;
00035     typedef baselib_binding::unique_lock<mutex>::type unique_lock;
00036 
00037     mutex mutex;
00038     
00039     bool running;        
00040 
00041     std::string topic;
00042     ros::NodeHandle& node;
00043 
00044     ros::Publisher pub;
00045 };
00046 
00047 #include <convenience_ros_functions/TypedPublisher.hpp>
00048 
00049 }
00050 
00051 #endif   // CONVENIENCE_ROS_FUNCTIONS_TYPEDSUBSCRIBER_H


convenience_ros_functions
Author(s): Jennifer Buehler
autogenerated on Sat Mar 2 2019 03:21:42