From b35361ea36a897788ace0c93b0a26b95e7356f79 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Thu, 11 Apr 2024 10:58:22 +0200 Subject: [PATCH] forgot to wait --- TCPServer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index a79d41c..46893f5 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -277,6 +277,7 @@ void TCPServer::startGame() { this->broadcastMessage("strat;servo_moteur;fermer pince;1\n"); this->broadcastMessage("strat;servo_moteur;fermer pince;2\n"); this->broadcastMessage("strat;servo_moteur;ouvrir pince;0\n"); + this->broadcastMessage("strat;arduino;speed;120\n"); waitForAruco = true; this->broadcastMessage("strat;aruco;get aruco;1\n"); @@ -294,8 +295,10 @@ void TCPServer::startGame() { // pi/4 this->broadcastMessage("strat;arduino;angle;0"); - usleep(1'000'000); + usleep(4'000'000); this->broadcastMessage("strat;aruco;get aruco;1\n"); + + waitForAruco = true; while (this->waitForAruco) { usleep(100'000); } @@ -314,7 +317,6 @@ void TCPServer::startGame() { } void TCPServer::goToAruco(const ArucoTagPos &arucoTagPos, const int pince) { - this->broadcastMessage("strat;arduino;speed;120\n"); float decalage; if (pince < 0 || pince > 2) { return; @@ -358,7 +360,6 @@ void TCPServer::goToAruco(const ArucoTagPos &arucoTagPos, const int pince) { this->broadcastMessage(toSend); this->broadcastMessage("strat;servo_moteur;lever bras;1\n"); havePot[pince] = true; - this->broadcastMessage("strat;arduino;speed;200\n"); } void TCPServer::askArduinoPos() {