Commit 76fd29a3 authored by Mohamed Ahmed's avatar Mohamed Ahmed

Adding subscription test

parent e43f95c5
......@@ -30,7 +30,7 @@ SampleType radar;
std::string eventName;
std::string eventState;
std::vector<SampleType> samplesVector;
std::vector<SampleType> samplesCache;
void eventStatus_callBack(const timeClient::subscription &msg);
void eventData_callBack(const timeClient::event_data &msg);
......
......@@ -16,19 +16,14 @@ 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
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(...){
std::cout<<"\n##############Bug\n###############\n";
if(getTimeClient.call(srv)){
ROS_INFO("ID_: %i\nHours: %i\nMinutes: %i\nSeconds: %i", srv.request.srv_id, 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();
}
}
......@@ -25,6 +25,8 @@ timeServiceProxy::timeServiceProxy(HandleType &handle):
BrakeEvent(rosHandler_)
{
std::cout<<"\nHello From Proxy Constructor\n"<<srv_ID<<std::endl;
size_t maxSampleCount = 10;
timeServiceProxy::BrakeEvent.Subscribe(maxSampleCount);
}
bool timeServiceProxy::HandleType::operator==(const HandleType &other) const
......
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