From 09f747fdefb1d61d88079c821b60d21d4c77e1a8 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Tue, 28 May 2024 20:23:10 +0200 Subject: [PATCH] distance --- GameControllerHandler.cpp | 2 +- GameControllerHandler.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/GameControllerHandler.cpp b/GameControllerHandler.cpp index 856f377..2989f44 100644 --- a/GameControllerHandler.cpp +++ b/GameControllerHandler.cpp @@ -47,7 +47,7 @@ void GameControllerHandler::handleMessage(const std::string &message) { if (distance <= 100) { strength = 0xFFFF; - } else if (distance <= 300) { + } else if (distance <= 500) { double factor = 1 - Modelec::mapValue(distance, 100.0, this->lidarDectectionDistance, 0.0, 1.0); strength = static_cast(factor * 0xFFFF); } else { diff --git a/GameControllerHandler.h b/GameControllerHandler.h index da64d98..c1674e9 100644 --- a/GameControllerHandler.h +++ b/GameControllerHandler.h @@ -27,7 +27,7 @@ public: private: SDL_GameController* controller; - double lidarDectectionDistance = 300; + double lidarDectectionDistance = 500; bool rumble = true;