Browse Source

普爱现场版本,增加车宽判断,调整电子围栏更新,避免过频繁跳动,20201209

yct 4 years ago
parent
commit
c2461f35ad
2 changed files with 8 additions and 3 deletions
  1. 1 1
      wj_lidar/detect_wheel_ceres.cpp
  2. 7 2
      wj_lidar/region_worker.cpp

+ 1 - 1
wj_lidar/detect_wheel_ceres.cpp

@@ -682,7 +682,7 @@ bool detect_wheel_ceres::Solve(Detect_result &detect_result, Loss_result &loss_r
         return false;
     }
 
-    detect_result.width += 0.15; //车宽+10cm
+    detect_result.width += 0.22; //车宽一边+11cm
     // printf(" x:%.3f  y: %.3f  wheel:%.3f  width:%.3f    theta : %.3f   front theta: %.3f\n",x,y,wheel_base,width,theta,front_theta);
 
     // //added by yct

+ 7 - 2
wj_lidar/region_worker.cpp

@@ -177,6 +177,11 @@ void Region_worker::detect_loop(Region_worker *worker)
                     border_status = verify_return_code;
                     //LOG(WARNING) << "region worker verify result: " << code;
                 }
+                // added by yct, check car width, width轮距+22cm
+                if(width > 1.92)
+                {
+                    border_status |= 0x000020;//第六位为车辆超宽
+                }
             }
             else
             {
@@ -202,8 +207,8 @@ void Region_worker::detect_loop(Region_worker *worker)
             if(p!=0) {
                 p->update_error_info(worker->m_detector->get_region_id(), t_error_info_str);
             }
-            // 写入间隔必须超过50ms,当前状态不同于上次写入状态,且该状态已连续读到两
-            if (p!=0 && duration > 50 && ((worker->m_last_sent_code != worker->m_last_read_code) || worker->m_last_border_status != border_status) && worker->m_read_code_count >= 2)
+            // 写入间隔必须超过100ms,当前状态不同于上次写入状态,且该状态已连续读到三
+            if (p!=0 && duration > 100 && ((worker->m_last_sent_code != worker->m_last_read_code) || worker->m_last_border_status != border_status) && worker->m_read_code_count >= 3)
             {
                 worker->m_last_sent_code = worker->m_last_read_code;
 		        worker->m_last_border_status = border_status;