detection range

This commit is contained in:
ackimixs
2024-05-28 18:23:05 +02:00
parent 7f61ce55d3
commit 172a6dcf2d
2 changed files with 2 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ void GameControllerHandler::handleMessage(const std::string &message) {
if (distance <= 100) {
strength = 0xFFFF;
} else if (distance <= 400) {
} else if (distance <= 300) {
double factor = 1 - Modelec::mapValue(distance, 100.0, this->lidarDectectionDistance, 0.0, 1.0);
strength = static_cast<Uint16>(factor * 0xFFFF);
} else {

View File

@@ -27,7 +27,7 @@ public:
private:
SDL_GameController* controller;
double lidarDectectionDistance = 400;
double lidarDectectionDistance = 300;
bool rumble = true;
};