From b2e897136989627ccddb3fded207a345ac23ac49 Mon Sep 17 00:00:00 2001 From: bap-0-1 Date: Tue, 28 May 2024 17:49:39 +0200 Subject: [PATCH] update --- TCPServer.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 9b9d7fb..55a35b1 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -173,8 +173,10 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) if (args[0] == "0") { if (!handleEmergecnyFlag) { - if (value < -23000) value = -23000; - if (value > 23000) value = 23000; + if (value < -15000) value = -15000; + if (value > 15000) value = 15000; + + if (value > -5000 && value < 5000) value = 0; int angle; if (value < 0) { @@ -182,7 +184,7 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) angle = -PI * 100 / 2; } else { - angle = static_cast(Modelec::mapValue(value, -23000.0, -2000.0, -PI / 2, 0.0) * 100); + angle = static_cast(Modelec::mapValue(value, -15000.0, -5000.0, -PI / 2, 0.0) * 100); } } else if (value == 0) { @@ -193,7 +195,7 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) angle = PI * 100 / 2; } else { - angle = static_cast(Modelec::mapValue(value, 2000.0, 23000.0, 0.0, PI / 2) * 100); + angle = static_cast(Modelec::mapValue(value, 5000.0, 15000.0, 0.0, PI / 2) * 100); } }