fix: update connection check method in sendKobukiData function

This commit is contained in:
ishak jmilou.ishak
2025-01-09 13:21:14 +01:00
parent 07d88eef7d
commit fa17893b1b

View File

@@ -325,9 +325,9 @@ std::string serializeKobukiData(const TKobukiData &data) {
// needed it so it can be threaded
void sendKobukiData(TKobukiData &data) {
while (true) {
if(!robot.connected()){
if(!robot.isConnected()){
std::cout << "Kobuki is not connected anymore" << std::endl;
while(!robot.connected()){
while(!robot.isConnected()){
robot.startCommunication("/dev/ttyUSB0", true, nullptr);
std::this_thread::sleep_for(std::chrono::seconds(1));
}