diff --git a/TCPServer.cpp b/TCPServer.cpp index 2f3c6fd..da5d832 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -122,6 +122,9 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) if (TCPUtils::contains(tokens[2], "stop proximity")) { std::vector args = TCPUtils::split(tokens[3], ","); + lidarDecetionDistance = stoi(args[0]); + // TODO distance de detection proportionnelle a la vitesse + if (stoi(args[0]) < 300) { stopEmergency = true; diff --git a/TCPServer.h b/TCPServer.h index 3b4a8e8..c3830b2 100644 --- a/TCPServer.h +++ b/TCPServer.h @@ -83,6 +83,8 @@ private: double lidarDectectionAngle = 0; + int lidarDecetionDistance = 0; + public: explicit TCPServer(int port);