mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-03 20:04:58 +00:00
commented my new code to check if bug is still here
This commit is contained in:
@@ -57,29 +57,29 @@ int main() {
|
|||||||
image.join();
|
image.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
void reconnectKobuki() {
|
// void reconnectKobuki() {
|
||||||
unsigned char *null_ptr(0);
|
// unsigned char *null_ptr(0);
|
||||||
while (true) {
|
// while (true) {
|
||||||
if (robot.startCommunication("/dev/ttyUSB0", true, null_ptr) != -1) {
|
// if (robot.startCommunication("/dev/ttyUSB0", true, null_ptr) != -1) {
|
||||||
std::cout << "Kobuki opnieuw verbonden!" << std::endl;
|
// std::cout << "Kobuki opnieuw verbonden!" << std::endl;
|
||||||
break; // Verlaat de loop als de verbinding succesvol is
|
// break; // Verlaat de loop als de verbinding succesvol is
|
||||||
} else {
|
// } else {
|
||||||
std::cerr << "Kobuki niet verbonden. Probeer opnieuw over 3 seconden..." << std::endl;
|
// std::cerr << "Kobuki niet verbonden. Probeer opnieuw over 3 seconden..." << std::endl;
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(3));
|
// std::this_thread::sleep_for(std::chrono::seconds(3));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
void monitorKobukiConnection() {
|
// void monitorKobukiConnection() {
|
||||||
while (true) {
|
// while (true) {
|
||||||
// Check regelmatig of de verbinding actief is
|
// // Check regelmatig of de verbinding actief is
|
||||||
if (!robot.isConnected()) {
|
// if (!robot.isConnected()) {
|
||||||
std::cerr << "Kobuki verbinding verloren. Reconnectie starten..." << std::endl;
|
// std::cerr << "Kobuki verbinding verloren. Reconnectie starten..." << std::endl;
|
||||||
reconnectKobuki();
|
// reconnectKobuki();
|
||||||
}
|
// }
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(5)); // Check iedere 5 seconden
|
// std::this_thread::sleep_for(std::chrono::seconds(5)); // Check iedere 5 seconden
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
std::string readMQTT() {
|
std::string readMQTT() {
|
||||||
|
Reference in New Issue
Block a user