Introduced condition variable in ROS2 subscriber to solve 500ms latency spikes

This commit is contained in:
Peter van der Perk
2019-11-05 15:09:44 +00:00
committed by Nuno Marques
parent ef475fa9d8
commit 08a27492b4
5 changed files with 26 additions and 25 deletions
+2 -2
View File
@@ -61,12 +61,12 @@ except AttributeError:
#include "RtpsTopics.h"
bool RtpsTopics::init()
bool RtpsTopics::init(std::condition_variable* cv)
{
@[if recv_topics]@
// Initialise subscribers
@[for topic in recv_topics]@
if (_@(topic)_sub.init()) {
if (_@(topic)_sub.init(cv)) {
std::cout << "@(topic) subscriber started" << std::endl;
} else {
std::cout << "ERROR starting @(topic) subscriber" << std::endl;