25 #ifndef MESSAGE_RELAY_RELAY_SERVICE_RELAY_H 26 #define MESSAGE_RELAY_RELAY_SERVICE_RELAY_H 49 : check_for_server_frequency(1.0)
66 template<
typename ServiceType >
79 server_options_ = ros::AdvertiseServiceOptions::create<ServiceType>(
84 client_ = origin_->serviceClient<ServiceType>(server_options_.service);
85 ROS_DEBUG_STREAM(
"Created service client at " << origin_->getNamespace() <<
"/" << server_options_.service
86 <<
", waiting for connection...");
92 wait_timer_ = origin_->createTimer(wait_timer_options);
97 ROS_INFO_STREAM(
"Searching for service server at " << origin_->getNamespace() <<
"/" << server_options_.service
101 ROS_INFO_STREAM(
"...found, creating relay server at " << target_->getNamespace() <<
"/" 102 << server_options_.service);
103 server_ = target_->advertiseService(server_options_);
113 bool serviceCb(
typename ServiceType::Request &req,
typename ServiceType::Response &res)
115 if (frame_id_processor_inverse_)
119 if (time_processor_inverse_)
124 client_.call(req, res);
126 if (frame_id_processor_)
150 #endif // MESSAGE_RELAY_RELAY_SERVICE_RELAY_H FrameIdProcessor::ConstPtr frame_id_processor_inverse_
boost::shared_ptr< ServiceRelay > Ptr
boost::shared_ptr< void const > VoidConstPtr
TimeProcessor::ConstPtr time_processor_inverse_
static void processRequest(typename Service::Request &req, typename Processor::ConstPtr &processor)
ServiceRelayImpl(const ServiceRelayParams ¶ms)
boost::shared_ptr< ros::NodeHandle > origin
static ConstPtr inverse(const ConstPtr &processor)
bool serviceCb(typename ServiceType::Request &req, typename ServiceType::Response &res)
boost::shared_ptr< ros::NodeHandle > target
ros::ServiceClient client_
static ConstPtr inverse(const ConstPtr &processor)
TimeProcessor::ConstPtr time_processor
boost::shared_ptr< ros::CallbackQueue > callback_queue
ros::ServiceServer server_
static void processResponse(typename Service::Response &res, typename Processor::ConstPtr &processor)
#define ROS_WARN_STREAM(args)
#define ROS_DEBUG_STREAM(args)
double check_for_server_frequency_
#define ROS_INFO_STREAM(args)
boost::shared_ptr< ros::NodeHandle > target_
double check_for_server_frequency
ros::AdvertiseServiceOptions server_options_
ServiceRelay::Ptr createServiceRelay(const ServiceRelayParams ¶ms)
FrameIdProcessor::ConstPtr frame_id_processor