mirror of
https://gitlab.fdmci.hva.nl/technische-informatica-sm3/ti-projectten/rooziinuubii79.git
synced 2025-08-04 12:24:57 +00:00
refactor: comment out connection check in sendKobukiData function
This commit is contained in:
@@ -325,13 +325,13 @@ std::string serializeKobukiData(const TKobukiData &data) {
|
|||||||
// needed it so it can be threaded
|
// needed it so it can be threaded
|
||||||
void sendKobukiData(TKobukiData &data) {
|
void sendKobukiData(TKobukiData &data) {
|
||||||
while (true) {
|
while (true) {
|
||||||
if(!robot.isConnected()){
|
// if(!robot.isConnected()){
|
||||||
std::cout << "Kobuki is not connected anymore" << std::endl;
|
// std::cout << "Kobuki is not connected anymore" << std::endl;
|
||||||
robot.startCommunication("/dev/ttyUSB0", true, nullptr);
|
// robot.startCommunication("/dev/ttyUSB0", true, nullptr);
|
||||||
while(!robot.isConnected()){
|
// while(!robot.isConnected()){
|
||||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
// std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
client.publishMessage("kobuki/data", serializeKobukiData(data));
|
client.publishMessage("kobuki/data", serializeKobukiData(data));
|
||||||
std::cout << "Sent data" << std::endl;
|
std::cout << "Sent data" << std::endl;
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||||
|
Reference in New Issue
Block a user