mirror of
https://github.com/modelec/TCPSocketServer.git
synced 2026-01-18 16:37:29 +01:00
stopEmergency
This commit is contained in:
@@ -450,8 +450,6 @@ void TCPServer::startGame() {
|
||||
gameStarted = true;
|
||||
for (int i = whereAmI; i < stratPatterns.size(); i++) {
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
auto time = std::chrono::system_clock::now();
|
||||
if (time - gameStart > std::chrono::seconds(82)) {
|
||||
this->goEnd();
|
||||
@@ -801,7 +799,6 @@ void TCPServer::awaitRobotIdle() {
|
||||
while (isRobotIdle < 2) {
|
||||
usleep(50'000);
|
||||
this->sendToClient("strat;arduino;get state;1\n", this->arduinoSocket);
|
||||
timeout++;
|
||||
if (stopEmergency) {
|
||||
while (stopEmergency) {
|
||||
stopEmergency = false;
|
||||
@@ -810,6 +807,7 @@ void TCPServer::awaitRobotIdle() {
|
||||
this->broadcastMessage(lastArduinoCommand);
|
||||
awaitRobotIdle();
|
||||
}
|
||||
timeout++;
|
||||
if (timeout > 80) {
|
||||
this->broadcastMessage("strat;arduino;clear;1");
|
||||
break;
|
||||
@@ -1361,8 +1359,6 @@ void TCPServer::dropJardiniereFlowers(const StratPattern sp) {
|
||||
}
|
||||
}
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
this->setMaxSpeed();
|
||||
|
||||
this->go(whiteDropSetup);
|
||||
@@ -1389,8 +1385,6 @@ void TCPServer::dropJardiniereFlowers(const StratPattern sp) {
|
||||
this->sendPoint(3+1);
|
||||
}
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
usleep(500'000);
|
||||
|
||||
this->closePince(0);
|
||||
@@ -1404,8 +1398,6 @@ void TCPServer::dropJardiniereFlowers(const StratPattern sp) {
|
||||
this->sendPoint(3+1);
|
||||
}
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
usleep(500'000);
|
||||
|
||||
this->openPince(0);
|
||||
@@ -1458,8 +1450,6 @@ void TCPServer::dropBaseFlowers(StratPattern sp) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
this->setMaxSpeed();
|
||||
|
||||
this->go(dropPosition);
|
||||
@@ -1474,8 +1464,6 @@ void TCPServer::dropBaseFlowers(StratPattern sp) {
|
||||
|
||||
this->baisserBras();
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
this->openPince(i);
|
||||
}
|
||||
@@ -1498,8 +1486,6 @@ void TCPServer::dropBaseFlowers(StratPattern sp) {
|
||||
this->closePince(i);
|
||||
}
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
if (!detectedPurple) {
|
||||
this->sendPoint(3);
|
||||
}
|
||||
@@ -1557,8 +1543,6 @@ void TCPServer::go3Plants(const StratPattern sp) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
this->setMaxSpeed();
|
||||
|
||||
this->transit(plantPosition[0]-(600*direction), plantPosition[1], 170);
|
||||
@@ -1582,7 +1566,6 @@ void TCPServer::go3Plants(const StratPattern sp) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
this->broadcastMessage("strat;aruco;get aruco;1\n");
|
||||
usleep(110'000);
|
||||
if (stopEmergency) return;
|
||||
}
|
||||
|
||||
std::vector<PinceState> pinceCanTakeFLower = getNotFallenFlowers();
|
||||
@@ -1601,8 +1584,6 @@ void TCPServer::go3Plants(const StratPattern sp) {
|
||||
|
||||
usleep(500'000);
|
||||
|
||||
if (stopEmergency) return;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
this->closePince(i);
|
||||
pinceState[i] = pinceCanTakeFLower[i];
|
||||
|
||||
Reference in New Issue
Block a user