Browse Source

增加平滑日志输出

lixioayao 5 năm trước cách đây
mục cha
commit
82c7bb3a4d
3 tập tin đã thay đổi với 9 bổ sung6 xóa
  1. 7 4
      loc_point.cpp
  2. 1 1
      loc_point.h
  3. 1 1
      select_tool.cpp

+ 7 - 4
loc_point.cpp

@@ -23,7 +23,7 @@ loc_point::loc_point()
     ,m_smooth_y(0)
     ,m_smooth_y(0)
 {
 {
     memset(&m_tof,0,sizeof(m_tof));
     memset(&m_tof,0,sizeof(m_tof));
-    //memset(&m_rsp,0,sizeof(m_rsp));
+    memset(&m_rsp,0,sizeof(m_rsp));
 }
 }
 
 
 loc_point& loc_point::reset()
 loc_point& loc_point::reset()
@@ -51,13 +51,12 @@ void loc_point::debug_out(const char *str)const
 #if 1
 #if 1
     log_info("[%s]t=%s,sit=%d,card=%d,ct=%d,cred=%d,"
     log_info("[%s]t=%s,sit=%d,card=%d,ct=%d,cred=%d,"
             "tof1=%d,tof2=%d,pt=(%.2lf,"
             "tof1=%d,tof2=%d,pt=(%.2lf,"
-            "%.2lf),rsp=1,acc=%.2f,dist=%.2lf,dist1=%.2lf,dist2=%.2lf,rav=%.2f,speed:%.2f\n",
+            "%.2lf),rsp=%d,acc=%.2f,dist=%.2lf,dist1=%.2lf,dist2=%.2lf,rav=%.2f,speed:%.2f\n",
             str,now(time_buff,m_time), m_sid, 
             str,now(time_buff,m_time), m_sid, 
 			m_cid,
 			m_cid,
 			m_ct, m_cred_level,
 			m_ct, m_cred_level,
             m_tof[0], m_tof[1],  x,
             m_tof[0], m_tof[1],  x,
-            //y ,(int)(m_rsp[0]+m_rsp[1])/2,m_acc,
-            y ,m_acc,
+            y ,(int)(m_rsp[0]+m_rsp[1])/2,m_acc,
             m_dist1,m_dist,m_dist2, m_rav,m_speed
             m_dist1,m_dist,m_dist2, m_rav,m_speed
           );
           );
 #else
 #else
@@ -96,6 +95,8 @@ void loc_point::set_source(const loc_message&li,const loc_message&li2)
     m_rav=li.m_rav;
     m_rav=li.m_rav;
     m_tof[li.m_ant_id]=li.m_num_ticks;
     m_tof[li.m_ant_id]=li.m_num_ticks;
     m_tof[li2.m_ant_id]=li2.m_num_ticks;
     m_tof[li2.m_ant_id]=li2.m_num_ticks;
+    m_rsp[li.m_ant_id]=li.m_rssi;
+    m_rsp[li2.m_ant_id]=li2.m_rssi;
     m_step=0;
     m_step=0;
 }
 }
 
 
@@ -109,5 +110,7 @@ void loc_point::set_source(const loc_message&li)
     m_rav=li.m_rav;
     m_rav=li.m_rav;
     m_tof[li.m_ant_id]=li.m_num_ticks;
     m_tof[li.m_ant_id]=li.m_num_ticks;
     m_tof[li.m_ant_id?0:1]=0;
     m_tof[li.m_ant_id?0:1]=0;
+    m_rsp[li.m_ant_id]=li.m_rssi;
+    m_rsp[li.m_ant_id?0:1]=0;
     m_step=0;
     m_step=0;
 }
 }

+ 1 - 1
loc_point.h

@@ -16,7 +16,7 @@ struct loc_point:point
 	float	m_rav;
 	float	m_rav;
 	int	    m_cred_level;
 	int	    m_cred_level;
 	int		m_tof[2];
 	int		m_tof[2];
-	//float	m_rsp[2];
+	float	m_rsp[2];
 	int	    m_step;
 	int	    m_step;
 	double  m_area;
 	double  m_area;
 	point   m_sol[2];
 	point   m_sol[2];

+ 1 - 1
select_tool.cpp

@@ -190,7 +190,7 @@ bool select_point_object::select_solution(const std::vector<point> &vp,const sit
 		m_d(0).set_cl(0);
 		m_d(0).set_cl(0);
 		if(m_last) m_d(0).m_dist=0.01*m_last->m_dist>0?1:-1;
 		if(m_last) m_d(0).m_dist=0.01*m_last->m_dist>0?1:-1;
 	}
 	}
-
+	m_d(0).m_dist1=sit->dist_direct(pt);
     //
     //
 	//std_info("revise_by_history:::%llu",m_d(0).m_time);
 	//std_info("revise_by_history:::%llu",m_d(0).m_time);
     bool fg=revise_by_history(pt,sit,m_d(0).m_time);
     bool fg=revise_by_history(pt,sit,m_d(0).m_time);