From a70e339b000ab9b9bfa7a9d793c2348fc1e3378e Mon Sep 17 00:00:00 2001 From: ackimixs Date: Wed, 22 May 2024 17:48:05 +0200 Subject: [PATCH] detection range --- GameControllerHandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GameControllerHandler.cpp b/GameControllerHandler.cpp index 1f0faaa..c19e3a0 100644 --- a/GameControllerHandler.cpp +++ b/GameControllerHandler.cpp @@ -45,8 +45,8 @@ void GameControllerHandler::handleMessage(const std::string &message) { if (distance <= 100) { strength = 0xFFFF; - } else if (distance <= this->lidarDectectionDistance / 2) { - double factor = 1 - Modelec::mapValue(distance, 100.0, this->lidarDectectionDistance / 2, 0.0, 1.0); + } else if (distance <= 300) { + double factor = 1 - Modelec::mapValue(distance, 100.0, this->lidarDectectionDistance, 0.0, 1.0); strength = static_cast(factor * 0xFFFF); } else { strength = 0;