增加了自动重连功能

This commit is contained in:
HinSon 2022-03-07 15:41:55 +08:00
parent 8bbc9d8961
commit 8b8c5fc4dd
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@
*/
#pragma once
#include "ros/ros.h"
#include "hins/laser_data_receiver.h"
#include <set>
namespace hins

View File

@ -212,7 +212,7 @@ void XingSongDriver::RunMain()
std::cout << "兴颂雷达启动失败,请检查网络连接." << std::endl;
}
while(true) // @todo: stop loop condition need to modified
while(ros::ok) // @todo: stop loop condition need to modified
{
if(IsConnected())
{
@ -220,7 +220,7 @@ void XingSongDriver::RunMain()
}
else
{
while(IsConnected()){
while(!IsConnected()){
std::cout << "激光雷达断线,正在重新连接 ... " << std::endl;
if(StartCapturingTCP()){
std::cout << "激光雷达重新连接成功." << std::endl;