microRTPS: add timesync for the agent side

This commit is contained in:
TSC21
2020-03-10 12:15:18 +00:00
committed by Nuno Marques
parent 152427ecdc
commit 170835f3f8
11 changed files with 331 additions and 7 deletions
+6 -2
View File
@@ -73,7 +73,6 @@ bool RtpsTopics::init(std::condition_variable* t_send_queue_cv, std::mutex* t_se
std::cerr << "Failed starting @(topic) subscriber" << std::endl;
return false;
}
@[end for]@
std::cout << "--------------------" << std::endl << std::endl;
@[end if]@
@@ -83,11 +82,13 @@ bool RtpsTopics::init(std::condition_variable* t_send_queue_cv, std::mutex* t_se
@[for topic in send_topics]@
if (_@(topic)_pub.init()) {
std::cout << "- @(topic) publisher started" << std::endl;
@[ if topic == 'Timesync']@
_timesync->start(&_@(topic)_pub);
@[ end if]@
} else {
std::cerr << "ERROR starting @(topic) publisher" << std::endl;
return false;
}
@[end for]@
std::cout << "--------------------" << std::endl;
@[end if]@
@@ -118,6 +119,9 @@ void RtpsTopics::publish(uint8_t topic_ID, char data_buffer[], size_t len)
eprosima::fastcdr::FastBuffer cdrbuffer(data_buffer, len);
eprosima::fastcdr::Cdr cdr_des(cdrbuffer);
st.deserialize(cdr_des);
@[ if topic == 'Timesync']@
_timesync->processTimesyncMsg(&st);
@[ end if]@
_@(topic)_pub.publish(&st);
}
break;