evitement

This commit is contained in:
ackimixs
2024-05-15 15:37:59 +02:00
parent fe993a180d
commit 6027077762

View File

@@ -175,10 +175,10 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket)
this->broadcastMessage("strat;arduino;speed;" + std::to_string(speed) + "\n");
}
else {
if (speed > 0 && (this->lidarDectectionAngle > PI / 3 || this->lidarDectectionAngle < - PI / 3)) {
if (speed > 0 && !(this->lidarDectectionAngle > PI / 2 || this->lidarDectectionAngle < - PI / 2)) {
this->broadcastMessage("strat;arduino;speed;" + std::to_string(speed) + "\n");
}
else if (speed < 0 && (this->lidarDectectionAngle < PI / 3 && this->lidarDectectionAngle > - PI / 3)) {
else if (speed < 0 && !(this->lidarDectectionAngle < PI / 2 && this->lidarDectectionAngle > - PI / 2)) {
this->broadcastMessage("strat;arduino;speed;" + std::to_string(speed) + "\n");
}
}