From 8e97ca255448b3613cfb2c46a86a264e0a6beff7 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Tue, 16 Apr 2024 11:33:24 +0200 Subject: [PATCH] change name and sleep --- TCPServer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/TCPServer.cpp b/TCPServer.cpp index 4d35dad..f92121e 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -453,13 +453,14 @@ void TCPServer::startGame() { this->broadcastMessage("strat;arduino;angle;-157"); this->broadcastMessage("strat;servo_moteur;baisser bras;1");*/ - std::string toSend = "stat;arduino;go;" + std::to_string(this->endRobotPose.pos.x) + "," + std::to_string(this->endRobotPose.pos.y) + "\n"; + std::string toSend = "strat;arduino;go;" + std::to_string(static_cast(this->endRobotPose.pos.x)) + "," + std::to_string(static_cast(this->endRobotPose.pos.y)) + "\n"; this->broadcastMessage(toSend); isRobotMoving = true; while (this->isRobotMoving) { usleep(500'000); this->broadcastMessage("strat;arduino;get state;1\n"); } + usleep(500'000); toSend = "start;arduino;angle;" + std::to_string(this->endRobotPose.theta * 100) + "\n"; this->broadcastMessage(toSend); @@ -531,7 +532,7 @@ void TCPServer::goToAruco(const ArucoTag &arucoTag, const int pince) { usleep(500'000); this->broadcastMessage("strat;arduino;get state;1\n"); } - usleep(1'000'000); + usleep(500'000); // ReSharper disable once CppDFAUnreachableCode // TODO set to 150 when the robot is ready