#ifndef LISTENER
#define LISTENER

#include "ros/ros.h"
#include "ros/callback_queue.h"
#include "ros/subscribe_options.h"
#include "std_msgs/String.h"

#include <math.h>
#include <stdio.h>
#include <thread>
#include "Try_1.h"

namespace gazebo{
	class Try_1;
	class Listener{
		private:
			std::unique_ptr<ros::NodeHandle> nodo;
			ros::Subscriber subscriber;
			ros::Publisher publisher;
			ros::CallbackQueue cola;
			ros::CallbackQueue cola2;
			std::thread threadColas;
			//static int contadorConexiones;
			Try_1 * robot;
			
		public:
			void init(Try_1 *,const std::string);
			void listener(const std_msgs::String::ConstPtr& msg);
			static void conexion(const ros::SingleSubscriberPublisher&);
			static void desconexion(const ros::SingleSubscriberPublisher&);
			void thread();
	};
}
#endif
