Commit 037db106 authored by Mohamed Ahmed's avatar Mohamed Ahmed

Debug_4

parent f5132ef3
......@@ -16,14 +16,18 @@ ara::core::Future<timeService::getTimeOutput> getTime::operator()()
srv.request.method_id = "getTime";
srv.request.srv_id = "x" + std::to_string(getTime::instanceID_);
//srv.request.srv_cmd = "start"; //Start offering service
if(getTimeClient.call(srv)){
ROS_INFO("\nHours: %i\nMinutes: %i\nSeconds: %i\n", srv.response.hours,srv.response.minutes,srv.response.seconds);
returnValue.hours = srv.response.hours;
returnValue.minutes = srv.response.minutes;
returnValue.seconds = srv.response.seconds;
ara::core::Promise<timeService::getTimeOutput> promise;
promise.set_value(returnValue);
return promise.get_future();
try{
if(getTimeClient.call(srv)){
ROS_INFO("\nHours: %i\nMinutes: %i\nSeconds: %i\n", srv.response.hours,srv.response.minutes,srv.response.seconds);
returnValue.hours = srv.response.hours;
returnValue.minutes = srv.response.minutes;
returnValue.seconds = srv.response.seconds;
ara::core::Promise<timeService::getTimeOutput> promise;
promise.set_value(returnValue);
return promise.get_future();
}
}catch(auto e){
std::cout<<"\n##############Bug\n###############\n";
}
}
......@@ -67,6 +67,10 @@ void Timeactivity::run()
{
std::cout << currentTime << " From service instance: " << INSTANCE_COLOR_40 << "40" << END_COLOR << std::endl;
}
else if(serviceInstances_ == 40)
{
std::cout << currentTime << " From service instance: " << INSTANCE_COLOR_40 << "60" << END_COLOR << std::endl;
}
}
else
......
......@@ -83,6 +83,7 @@ void callback(const timeClient::srv_info &msg)
else if(msg.current_state == "off" && timeServiceProxy::handlesVec.size()>0) //Last time to see the service at this time
{
std::cout<<"\n##################\nThe state is: "<<msg.current_state<<"\n####################\n";
timeServiceProxy::HandleType handle;
handle.SetInstanceId(timeServiceProxy::instanceID_);
ara::com::FindServiceHandle f;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment