detection range

This commit is contained in:
ackimixs
2024-05-28 18:21:29 +02:00
parent 27b20d3b12
commit 7f61ce55d3

View File

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