|
@@ -64,7 +64,6 @@ Error_manager Dispatch_ground_lidar::dispatch_ground_lidar_uninit()
|
|
|
// return Error_code::SUCCESS;
|
|
|
//}
|
|
|
|
|
|
-
|
|
|
//调度地面雷达 执行状态消息
|
|
|
Error_manager Dispatch_ground_lidar::execute_for_ground_status_msg_new(measure_info &t_measure_info)
|
|
|
{
|
|
@@ -72,25 +71,25 @@ Error_manager Dispatch_ground_lidar::execute_for_ground_status_msg_new(measure_i
|
|
|
m_measure_info = t_measure_info;
|
|
|
m_ground_status_msg_updata_time = std::chrono::system_clock::now();
|
|
|
m_ground_status_msg_updata_flag = true;
|
|
|
+
|
|
|
//胡力 新增 接受雷达雷达 通信周期 超过1秒就打印
|
|
|
int time_key = 10+m_ground_lidar_id;
|
|
|
Time_tool::get_instance_references().time_end(time_key);
|
|
|
if ( Time_tool::get_instance_references().timetool_map.find(time_key)!=Time_tool::get_instance_references().timetool_map.end() )
|
|
|
{
|
|
|
- if ( Time_tool::get_instance_references().timetool_map[time_key].t_time_difference >= std::chrono::milliseconds(1000) )
|
|
|
- {
|
|
|
+ if ( Time_tool::get_instance_references().timetool_map[time_key].t_time_difference >= std::chrono::milliseconds(1000) )
|
|
|
+ {
|
|
|
Time_tool::get_instance_references().cout_time_millisecond(time_key);
|
|
|
- double dieoutTime=(double)Time_tool::get_instance_references().timetool_map[time_key].t_time_difference.count()/1000000;
|
|
|
-// std::cout << "计时器:"<<key<<" 计时的时间为:" <<dieoutTime<<" 毫秒" << std::endl;
|
|
|
- LOG(INFO) << "计时器:"<<time_key<<" 计时的时间为:" <<dieoutTime<<" 毫秒" << " --- " << this;
|
|
|
- }
|
|
|
+ double dieoutTime=(double)Time_tool::get_instance_references().timetool_map[time_key].t_time_difference.count()/1000000;
|
|
|
+ LOG(INFO) << "计时器:"<<time_key<<" 计时的时间为:" <<dieoutTime<<" 毫秒" << " --- " << this;
|
|
|
+ }
|
|
|
}
|
|
|
Time_tool::get_instance_references().time_start(time_key);
|
|
|
//胡力 新增 接受雷达雷达 通信周期 超过1秒就打印
|
|
|
+
|
|
|
return Error_code::SUCCESS;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
Dispatch_ground_lidar::Dispatch_ground_lidar_status Dispatch_ground_lidar::get_dispatch_ground_lidar_status()
|
|
|
{
|
|
|
return m_dispatch_ground_lidar_status;
|
|
@@ -122,6 +121,9 @@ void Dispatch_ground_lidar::execute_thread_fun()
|
|
|
std::unique_lock<std::mutex> t_lock(Dispatch_communication::get_instance_references().m_data_lock);
|
|
|
std::unique_lock<std::mutex> t_lock2(m_lock);
|
|
|
|
|
|
+ check_measure_info(m_measure_info);
|
|
|
+
|
|
|
+
|
|
|
//将nnxx的protobuf 转化为 snap7的DB块, 把店面雷达数据转发给plc
|
|
|
// int t_inlet_id = m_ground_status_msg.mutable_id_struct()->terminal_id() % 2;
|
|
|
int t_inlet_id = m_ground_lidar_id;
|
|
@@ -166,6 +168,7 @@ void Dispatch_ground_lidar::execute_thread_fun()
|
|
|
|
|
|
p_response_data->m_response_locate_correct = 1; //locate_correct 0=无效, 1=有效,
|
|
|
p_response_data->m_response_ground_status = m_measure_info.ground_status(); //0 ok 1,nothing 2,noise 3,border
|
|
|
+ p_response_data->m_response_border_status = m_measure_info.border_statu(); //超界状态描述, 按位运算
|
|
|
|
|
|
}
|
|
|
else
|
|
@@ -184,6 +187,8 @@ void Dispatch_ground_lidar::execute_thread_fun()
|
|
|
|
|
|
p_response_data->m_response_locate_correct = 0;
|
|
|
p_response_data->m_response_ground_status = m_measure_info.ground_status(); //0 ok 1,nothing 2,noise 3,border
|
|
|
+ p_response_data->m_response_border_status = m_measure_info.border_statu(); //超界状态描述, 按位运算
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// LOG(WARNING) << "------------------------------------------------------------ "<<std::endl;
|
|
@@ -237,6 +242,8 @@ void Dispatch_ground_lidar::execute_thread_fun()
|
|
|
|
|
|
p_response_data->m_response_locate_correct = 1; //locate_correct 0=无效, 1=有效,
|
|
|
p_response_data->m_response_ground_status = m_measure_info.ground_status(); //0 ok 1,nothing 2,noise 3,border
|
|
|
+ p_response_data->m_response_border_status = m_measure_info.border_statu(); //超界状态描述, 按位运算
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -254,6 +261,8 @@ void Dispatch_ground_lidar::execute_thread_fun()
|
|
|
|
|
|
p_response_data->m_response_locate_correct = 0;
|
|
|
p_response_data->m_response_ground_status = m_measure_info.ground_status(); //0 ok 1,nothing 2,noise 3,border
|
|
|
+ p_response_data->m_response_border_status = m_measure_info.border_statu(); //超界状态描述, 按位运算
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -278,7 +287,17 @@ void Dispatch_ground_lidar::execute_thread_fun()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+//检查感测消息
|
|
|
+Error_manager Dispatch_ground_lidar::check_measure_info(measure_info &t_measure_info)
|
|
|
+{
|
|
|
+ if ( t_measure_info.theta() > 10 ||
|
|
|
+ t_measure_info.theta() < -10)
|
|
|
+ {
|
|
|
+ LOG(INFO) << " 地面雷达数据异常, t_measure_info = " << t_measure_info.DebugString().c_str() << " --- " ;
|
|
|
+ }
|
|
|
|
|
|
+ return Error_code::SUCCESS;
|
|
|
+}
|
|
|
|
|
|
|
|
|
|