Browse Source

2021.8.5 status switch and correctness debug

yct 3 years ago
parent
commit
5b705f29a1

+ 3 - 1
.gitignore

@@ -141,4 +141,6 @@ CCCoreLibExport.h
 *.cfg
 *.pb
 *ckpt*
-*.weights
+*.weights
+*.pb*
+*.prototxt

+ 1 - 5
CMakeLists.txt

@@ -88,8 +88,6 @@ add_executable(measure_wj
 target_link_libraries(measure_wj
         /usr/local/lib/libglog.a
         /usr/local/lib/libgflags.a
-        /usr/local/lib/liblivox_sdk_static.a
-        /usr/local/apr/lib/libapr-1.a
         nnxx
         nanomsg
 
@@ -126,8 +124,6 @@ ${VELODYNE_LIDAR}
 target_link_libraries(vlp16 
 /usr/local/lib/libglog.a
 /usr/local/lib/libgflags.a
-/usr/local/lib/liblivox_sdk_static.a
-/usr/local/apr/lib/libapr-1.a
 nnxx
 nanomsg
 
@@ -137,4 +133,4 @@ ${GLOG_LIBRARIES}
 ${PCL_LIBRARIES}
 ${CERES_LIBRARIES}
 ${YAML_CPP_LIBRARIES}
-)
+)

+ 1 - 0
system/system_executor.cpp

@@ -303,6 +303,7 @@ Error_manager System_executor::encapsulate_send_status()
         t_multi_status_msg.mutable_error_manager()->set_error_description(t_error.get_error_description(), t_error.get_description_length());
         std::string t_msg = t_multi_status_msg.SerializeAsString();
         System_communication::get_instance_references().encapsulate_msg(t_msg);
+//        std::cout<<t_multi_status_msg.DebugString()<<std::endl<<std::endl;
 	}
 
 	// 普爱统一一个万集节点, 各终端消息分别发送

+ 8 - 2
velodyne_lidar/ground_region.cpp

@@ -413,7 +413,10 @@ Error_manager Ground_region::get_current_wheel_information(Common_data::Car_whee
 	if( m_detect_update_time > command_time )
 	{
 		*p_car_wheel_information = m_car_wheel_information;
-		return Error_code::SUCCESS;
+		if(m_car_wheel_information.correctness)
+		    return Error_code::SUCCESS;
+		else
+		    return Error_manager(Error_code::VELODYNE_REGION_CERES_SOLVE_ERROR, Error_level::MINOR_ERROR, " Ground_region detect error");
 	}
 	else
 	{
@@ -434,7 +437,10 @@ Error_manager Ground_region::get_last_wheel_information(Common_data::Car_wheel_i
 	if( m_detect_update_time > command_time - std::chrono::milliseconds(GROUND_REGION_DETECT_CYCLE_MS))
 	{
 		*p_car_wheel_information = m_car_wheel_information;
-		return Error_code::SUCCESS;
+        if(m_car_wheel_information.correctness)
+            return Error_code::SUCCESS;
+        else
+            return Error_manager(Error_code::VELODYNE_REGION_CERES_SOLVE_ERROR, Error_level::MINOR_ERROR, " Ground_region detect error ");
 	}
 	else
 	{

+ 1 - 1
velodyne_lidar/velodyne_driver/rawdata.cc

@@ -715,7 +715,7 @@ namespace velodyne_rawdata
         // some packets contain an angle overflow where azimuth_diff < 0
         if (raw_azimuth_diff < 0) //raw->blocks[block+1].rotation - raw->blocks[block].rotation < 0)
         {
-          LOG_EVERY_N(INFO, 1) << "Packet containing angle overflow, first angle: " << raw->blocks[block].rotation << " second angle: " << raw->blocks[block + 1].rotation;
+          LOG_EVERY_N(INFO, 10000) << "Packet containing angle overflow, first angle: " << raw->blocks[block].rotation << " second angle: " << raw->blocks[block + 1].rotation;
           // if last_azimuth_diff was not zero, we can assume that the velodyne's speed did not change very much and use the same difference
           if (last_azimuth_diff > 0)
           {

+ 6 - 2
velodyne_lidar/velodyne_driver/velodyne_lidar_device.cpp

@@ -477,11 +477,14 @@ void Velodyne_lidar_device::updata_status()
 	if (m_velodyne_socket_status == E_FAULT || m_velodyne_protocol_status == E_FAULT)
 	{
 		m_velodyne_lidar_device_status = E_FAULT;
-	}
-	if (m_velodyne_socket_status == E_DISCONNECT)
+	}else if (m_velodyne_socket_status == E_DISCONNECT)
 	{
 		m_velodyne_lidar_device_status = E_DISCONNECT;
 	}
+	else if(m_velodyne_socket_status == E_BUSY || m_velodyne_protocol_status == E_BUSY)
+    {
+        m_velodyne_lidar_device_status = E_BUSY;
+    }
 	else if (m_velodyne_socket_status == E_READY && m_velodyne_protocol_status == E_READY)
 	{
 		if (m_execute_condition.get_pass_ever())
@@ -495,6 +498,7 @@ void Velodyne_lidar_device::updata_status()
 	}
 	else
 	{
+//	    LOG(WARNING)<<"unknown????? "<<m_velodyne_socket_status<<", "<<m_velodyne_protocol_status;
 		m_velodyne_lidar_device_status = E_UNKNOWN;
 	}
 }