From 89eab6b16fc68082ad7897ac100c8385c758d99c Mon Sep 17 00:00:00 2001 From: ackimixs Date: Thu, 18 Apr 2024 19:40:57 +0200 Subject: [PATCH] sleep --- TCPServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 626bffe..2219e67 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -202,7 +202,7 @@ void TCPServer::handleMessage(const std::string& message, int clientSocket) spawnPoint[2] = 3.1415; finishPoint[0] = 2600; finishPoint[1] = 400; - finishPoint[1] = 0; + finishPoint[2] = 0; break; default: @@ -374,6 +374,7 @@ void TCPServer::startGameBlueTeam() { // TODO redo that part because that give point to the other team this->broadcastMessage("strat;arduino;speed;130\n"); this->broadcastMessage("strat;servo_moteur;check panneau;7\n"); + usleep(100'000); std::string toSend = "strat;arduino;go;380," + std::to_string(static_cast(this->robotPose.pos.y)) + "\n"; this->broadcastMessage(toSend); awaitRobotIdle(); @@ -387,6 +388,7 @@ void TCPServer::startGameBlueTeam() { awaitRobotIdle(); this->broadcastMessage("strat;servo_moteur;check panneau;7\n"); + usleep(100'000); toSend = "strat;arduino;go;620," + std::to_string(static_cast(this->robotPose.pos.y)) + "\n"; this->broadcastMessage(toSend); @@ -401,6 +403,7 @@ void TCPServer::startGameBlueTeam() { awaitRobotIdle(); this->broadcastMessage("strat;servo_moteur;check panneau;7\n"); + usleep(100'000); toSend = "strat;arduino;go;805," + std::to_string(static_cast(this->robotPose.pos.y)) + "\n"; this->broadcastMessage(toSend);