Parcourir la source

20221209, ground_status

huli il y a 2 ans
Parent
commit
5999999427

+ 4 - 2
plc调度节点/dispatch/dispatch_communication.cpp

@@ -275,8 +275,10 @@ Error_manager Dispatch_communication::communication_init(int plc_id)
 	t_index += sizeof(float)*1;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_response_locate_correct", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
 	t_index += sizeof(unsigned char)*1;
-	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved45_48", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 3 });
-	t_index += sizeof(unsigned char)*3;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_response_ground_status", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
+	t_index += sizeof(unsigned char)*1;
+	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_reserved46_47", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 2 });
+	t_index += sizeof(unsigned char)*2;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_heartbeat", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });
 	t_index += sizeof(unsigned char)*1;
 	t_variable_information_vector.push_back(Snap7_buf::Variable_information{"m_communication_mode", typeid(unsigned char).name(), t_index,sizeof(unsigned char), 1 });

+ 3 - 1
plc调度节点/dispatch/dispatch_communication.h

@@ -482,7 +482,9 @@ public:
 		float					m_response_uniformed_car_y = 0;					//转角复位后,车辆中心点y
 		unsigned char			m_response_locate_correct = 0;				//数据是否有效, 0=无效, 1=有效
 
-		unsigned char			m_reserved45_48[3] = {0};							//预留
+		unsigned char			m_response_ground_status = 0;				//数据是否有效, 0=无效, 1=有效
+		unsigned char			m_reserved46_47[2] = {0};							//预留
+
 		unsigned char			m_response_heartbeat = 0;							//心跳位, 0-255循环
 		unsigned char			m_response_communication_mode = 0;					//通信模式	0 = 未知, 1=自动循环模式,2=手动刷新模式
 		unsigned char			m_response_refresh_command = 0;						//刷新指令 0-255任意数字,与上一次不同即可

+ 9 - 8
plc调度节点/dispatch/dispatch_ground_lidar.cpp

@@ -105,11 +105,7 @@ 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);
 
-
-
-
-
-                //将nnxx的protobuf 转化为 snap7的DB块,  把店面雷达数据转发给plc
+				//将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;
 				Dispatch_communication::Ground_lidar_response_from_manager_to_plc_for_data *p_response_data = &Dispatch_communication::get_instance_references().m_ground_lidar_response_from_manager_to_plc_for_data[t_inlet_id];
@@ -152,6 +148,8 @@ void Dispatch_ground_lidar::execute_thread_fun()
                         p_response_data->m_response_uniformed_car_y = m_measure_info.cy();
 
 						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
+
 					}
 					else
                     {
@@ -168,7 +166,8 @@ void Dispatch_ground_lidar::execute_thread_fun()
                         p_response_data->m_response_uniformed_car_y = 0;
 
                         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
+					}
 
 //                    LOG(WARNING) << "------------------------------------------------------------ "<<std::endl;
 //                    LOG(WARNING) << "m_measure_info = " << m_measure_info.ground_status() <<std::endl;
@@ -220,7 +219,8 @@ void Dispatch_ground_lidar::execute_thread_fun()
                         p_response_data->m_response_uniformed_car_y = m_measure_info.cy();
 
                         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
+					}
                     else
                     {
                         p_response_data->m_response_car_center_x = 0;
@@ -236,7 +236,8 @@ void Dispatch_ground_lidar::execute_thread_fun()
                         p_response_data->m_response_uniformed_car_y = 0;
 
                         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
+					}
 				}
 
 				m_ground_status_msg_updata_flag = false;