Skip to content
Snippets Groups Projects
Commit c37febb8 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Checked whether the service client is connected to the server or not.

parent 4e49eefe
No related branches found
No related tags found
No related merge requests found
......@@ -247,10 +247,15 @@ void AdcJuryServerAlgNode::node_config_update(Config &config, uint32_t level)
}
ROS_INFO("AdcJuryServerAlgNode:: Calling service set_lights_client_!");
if (set_lights_client_.call(set_lights_srv_))
ROS_INFO("AdcJuryServerAlgNode:: set_lights_client_ received a response from service server");
if(set_lights_client_.waitForExistence(ros::Duration(0)))
{
if (set_lights_client_.call(set_lights_srv_))
ROS_INFO("AdcJuryServerAlgNode:: set_lights_client_ received a response from service server");
else
ROS_ERROR("AdcJuryServerAlgNode:: Failed to call service on topic %s",this->set_lights_client_.getService().c_str());
}
else
ROS_ERROR("AdcJuryServerAlgNode:: Failed to call service on topic %s",this->set_lights_client_.getService().c_str());
ROS_ERROR("AdcJuryServerAlgNode:: Service not connected");
}
this->config_=config;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment