From 3ba74ae82ffd206a9fec3fd8036ab262a0249d75 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Mon, 8 Apr 2024 22:07:15 +0200 Subject: [PATCH] change timing --- TCPServer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 2faf736..4baea6c 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -163,7 +163,7 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) this->broadcastMessage(message.c_str(), clientSocket); this->actionNb = 0; this->broadcastMessage("strat;servo_moteur;baisser bras;1\n"); - this->broadcastMessage("strat;servo_moteur;ouvrir pince;1\n"); + this->broadcastMessage("strat;servo_moteur;ouvrir pince;0\n"); this->broadcastMessage("strat;aruco;get aruco;1\n"); } if (tokens[0] == "aruco" && tokens[2] == "get aruco") { @@ -174,18 +174,18 @@ 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[2])); + int x = static_cast(std::stof(arucoArgs[2])) - 70; 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"); + this->broadcastMessage("strat;servo_moteur;fermer pince;0\n"); this->broadcastMessage("strat;servo_moteur;lever bras;1\n"); usleep(1'000'000); this->broadcastMessage("strat;arduino;go;1000,1500\n"); usleep(6'000'000); this->broadcastMessage("strat;servo_moteur;baisser bras;1\n"); - this->broadcastMessage("strat;servo_moteur;ouvrir pince;1\n"); + this->broadcastMessage("strat;servo_moteur;ouvrir pince;0\n"); usleep(2'000'000); this->broadcastMessage("strat;arduino;go;500,500\n"); }