mirror of
https://github.com/modelec/TCPSocketServer.git
synced 2026-03-28 10:29:43 +01:00
forgot to wait
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user