From ccbf983023e8a60e94bc7f6c67313d6fc188ef5d Mon Sep 17 00:00:00 2001 From: ackimixs Date: Wed, 8 May 2024 15:18:47 +0200 Subject: [PATCH] sleep --- TCPServer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 8270d0b..6c6a0b6 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -123,8 +123,6 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) return; } if (TCPUtils::contains(tokens[2], "stop proximity")) { - if (!gameStarted) return; - this->broadcastMessage("strat;arduino;clear;1\n"); this->stopEmergency = true; @@ -917,7 +915,8 @@ void TCPServer::handleEmergency(int distance, double angle) { this->broadcastMessage("strat;arduino;clear;3\n"); this->stopEmergency = false; - usleep(1'000'000); + + std::this_thread::sleep_for(std::chrono::seconds(2)); /*double newAngle = this->robotPose.theta + angle; double newX = this->robotPose.pos.x + 200 * std::cos(newAngle);