fix thread going out of scope

This commit is contained in:
2024-11-04 13:23:02 +01:00
parent 0dc267536e
commit c3270a1c47

View File

@@ -19,16 +19,17 @@ void setup(){
robot.startCommunication("/dev/ttyUSB0", true, null_ptr);
client.connect();
client.subscribe("home/commands");
std::thread safety([&]() { robot.robotSafety(&message); });
}
int main(){
setup();
std::thread safety([&]() { robot.robotSafety(&message); });
while(true){
parseMQTT(readMQTT());
}
safety.join();
return 0;
}