From 6027077762e526ffbe81645b22f5f582be2a0ca1 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Wed, 15 May 2024 15:37:59 +0200 Subject: [PATCH] evitement --- TCPServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index a553b66..07c174c 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -175,10 +175,10 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) this->broadcastMessage("strat;arduino;speed;" + std::to_string(speed) + "\n"); } else { - if (speed > 0 && (this->lidarDectectionAngle > PI / 3 || this->lidarDectectionAngle < - PI / 3)) { + if (speed > 0 && !(this->lidarDectectionAngle > PI / 2 || this->lidarDectectionAngle < - PI / 2)) { this->broadcastMessage("strat;arduino;speed;" + std::to_string(speed) + "\n"); } - else if (speed < 0 && (this->lidarDectectionAngle < PI / 3 && this->lidarDectectionAngle > - PI / 3)) { + else if (speed < 0 && !(this->lidarDectectionAngle < PI / 2 && this->lidarDectectionAngle > - PI / 2)) { this->broadcastMessage("strat;arduino;speed;" + std::to_string(speed) + "\n"); } }