增加了自动重连功能
This commit is contained in:
parent
8bbc9d8961
commit
8b8c5fc4dd
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ros/ros.h"
|
||||
#include "hins/laser_data_receiver.h"
|
||||
#include <set>
|
||||
namespace hins
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user