From 57a2c9817dfdfa46b7c6ca1b55ba0ba3f647c2e1 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Mon, 8 Apr 2024 21:40:00 +0200 Subject: [PATCH] change index --- TCPServer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 988fe18..73e2f29 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -174,9 +174,9 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) } else { std::cout << "Aruco tags received" << std::endl; std::vector arucoArgs = split(aruco, ","); - int x = static_cast(std::stof(arucoArgs[0])); - int y = static_cast(std::stof(arucoArgs[2])); - std::string toSend = "strat;arduino;go;" + std::to_string(y) + "," + std::to_string(x); + int x = static_cast(std::stof(arucoArgs[2])); + int y = static_cast(std::stof(arucoArgs[4])); + std::string toSend = "strat;arduino;go;" + std::to_string(x) + "," + std::to_string(y); this->broadcastMessage(toSend.c_str()); usleep(3'000'000); this->broadcastMessage("strat;servo_moteur;fermer pince;1\n");