From 704c530bed7c4836fd3fc6e04bb8e1518454a7c0 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Thu, 9 May 2024 14:20:02 +0200 Subject: [PATCH] timeout liar --- TCPServer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TCPServer.cpp b/TCPServer.cpp index 16c9bfd..200dd32 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -1662,10 +1662,16 @@ void TCPServer::getLidarPos() { this->askLidarPosition(); + int timeout = 0; + // ReSharper disable once CppDFAConstantConditions // ReSharper disable once CppDFAEndlessLoop while (awaitForLidar) { usleep(50'000); + timeout++; + if (timeout > 100) { + break; + } } // ReSharper disable once CppDFAUnreachableCode