From 23b1fb3aae8ebc24fecc901182f3394dfcfe92ce Mon Sep 17 00:00:00 2001 From: ackimixs Date: Wed, 15 May 2024 20:46:30 +0200 Subject: [PATCH] condition --- TCPServer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 6a4517a..7ff77a1 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -189,10 +189,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 / 2 || this->lidarDectectionAngle > 3 * PI / 2)) { + if (speed > 0 && !(this->lidarDectectionAngle < PI / 2 && this->lidarDectectionAngle > 3 * PI / 2)) { this->broadcastMessage("strat;arduino;speed;" + std::to_string(speed) + "\n"); } - else if (speed < 0 && !(this->lidarDectectionAngle > PI / 2 || this->lidarDectectionAngle < 3 * PI / 2)) { + else if (speed < 0 && !(this->lidarDectectionAngle > PI / 2 && this->lidarDectectionAngle < 3 * PI / 2)) { this->broadcastMessage("strat;arduino;speed;" + std::to_string(speed) + "\n"); } }