added parameters

This commit is contained in:
ishak jmilou.ishak
2025-01-07 14:33:12 +01:00
parent b111e49dff
commit 56f085b73d

View File

@@ -53,11 +53,12 @@ int main() {
}
void reconnectKobuki() {
unsigned char *null_ptr(0);
while (true) {
if (robot.startCommunication("/dev/ttyUSB0") != -1) {
if (robot.startCommunication("/dev/ttyUSB0", true, null_ptr) != -1) {
std::cout << "Kobuki opnieuw verbonden!" << std::endl;
break; // Verlaat de loop als de verbinding succesvol is
} else {
} else {
std::cerr << "Kobuki niet verbonden. Probeer opnieuw over 3 seconden..." << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(3));
}