From 93a3cff323e39da4476ffb8a61da0202828ba4d8 Mon Sep 17 00:00:00 2001 From: ackimixs Date: Fri, 3 May 2024 15:00:53 +0200 Subject: [PATCH] points --- TCPServer.cpp | 13 +++++++++++++ TCPServer.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/TCPServer.cpp b/TCPServer.cpp index 9167fe7..d767deb 100644 --- a/TCPServer.cpp +++ b/TCPServer.cpp @@ -880,8 +880,11 @@ void TCPServer::goEnd() { this->middlePince(i); usleep(50'000); } + this->sendPoint(10); this->broadcastMessage("strat;all;end;1"); + this->sendPoint(10); + this->sendPoint(5); } void TCPServer::findAndGoFlower(const StratPattern sp) { @@ -1012,6 +1015,8 @@ void TCPServer::dropPurpleFlowers() { pinceState[toDrop] = NONE; this->closePince(toDrop); usleep(200'000); + + this->sendPoint(3); } } @@ -1113,6 +1118,8 @@ void TCPServer::dropWhiteFlowers(StratPattern sp) { pinceState[i] = NONE; this->closePince(i); usleep(100'000); + + this->sendPoint(4); } } @@ -1214,6 +1221,8 @@ void TCPServer::goAndTurnSolarPanel(StratPattern sp) { } } + this->sendPoint(5); + this->setSpeed(previousSpeed); } @@ -1383,3 +1392,7 @@ void TCPServer::uncheckPanneau(int servo_moteur) { void TCPServer::askLidarPosition() { this->broadcastMessage("start;lidar;get pos;1\n"); } + +void TCPServer::sendPoint(int point) { + this->broadcastMessage("strat;ihm;add point;" + std::to_string(point) + "\n"); +} diff --git a/TCPServer.h b/TCPServer.h index e32fec7..9ac90a7 100644 --- a/TCPServer.h +++ b/TCPServer.h @@ -268,5 +268,7 @@ public: void askLidarPosition(); + void sendPoint(int point); + ~TCPServer(); };