|
@@ -88,7 +88,11 @@ bool select_point_object::select_pdoa_solution_impl(const std::vector<point> vp,
|
|
|
{
|
|
|
switch(get_algo_index(lm[0].tool_index())){
|
|
|
case 6:
|
|
|
- return select_pdoa_1d_solution(vp, lm, lp);
|
|
|
+ if(lm[0].m_sync_ct){
|
|
|
+ return select_pdoa_1d_solution_original(vp, lm, lp);
|
|
|
+ }else{
|
|
|
+ return select_pdoa_1d_solution(vp, lm, lp);
|
|
|
+ }
|
|
|
break;
|
|
|
case 7:
|
|
|
return select_pdoa_2d_solution(vp, lm, lp);
|
|
@@ -503,6 +507,64 @@ bool select_point_object::select_pdoa_solution2(const std::vector<point> vp, con
|
|
|
return true;
|
|
|
}*/
|
|
|
|
|
|
+/*
|
|
|
+ * 选择一维定位的解,不采用任何优化方法
|
|
|
+ *
|
|
|
+ * 参数
|
|
|
+ * const std::vector<point> vp 可能定位解
|
|
|
+ * const std::vector<loc_message>& lm 定位原始数据集
|
|
|
+ * loc_point& lp 保存最终定位解
|
|
|
+ *
|
|
|
+ * 返回值
|
|
|
+ * true表示成功选解,false表示选解失败
|
|
|
+ *
|
|
|
+ * */
|
|
|
+bool select_point_object::select_pdoa_1d_solution_original(const std::vector<point> vp, const std::vector<loc_message>& lm, loc_point& lp)
|
|
|
+{
|
|
|
+ uint64_t id = lm[0].m_card_type;
|
|
|
+ id = ((id<<32)|lm[0].m_card_id);
|
|
|
+
|
|
|
+ auto card= card_list::instance()->get(id);
|
|
|
+ double dist = lm[0].m_num_ticks * 15.65 * 2.996 * 1e-4;
|
|
|
+
|
|
|
+ double pdoa = get_pdoa(lm[0].m_poa, lm[0].m_sit->m_pdoa_offset);
|
|
|
+ logn_info(3, "[pdoa_o] card_id=%d, pdoa=%.2f, dist=%.2f, vp0x=%.2f, vp0y=%.2f, vp1x=%.2f, vp2y=%.2f", lm[0].m_card_id, pdoa, dist, vp[0].x, vp[0].y, vp[1].x, vp[1].y);
|
|
|
+
|
|
|
+ double dt = (lm[0].m_loc_time - card->m_last_recv_time)*1.0/1000.0;
|
|
|
+ double speed = fabs(dist - card->m_last_dist)/dt;
|
|
|
+
|
|
|
+ if(!select_pdoa_solution2(vp, lm, lp, pdoa)){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ logn_info(3, "[pdoa_o] card_id=%d, ct=%d, useless=%d, x=%.4f, y=%.4f, speed=%.3f, d=%.2f", lm[0].m_card_id, lm[0].m_card_ct, 1, lp.x, lp.y, speed);
|
|
|
+
|
|
|
+ lp.m_useless = true;
|
|
|
+ card->m_last_pdoa_diff = pdoa;
|
|
|
+ card->m_last_ct = lm[0].m_card_ct;
|
|
|
+ card->m_last_dist = dist;
|
|
|
+ card->m_last_site_id = lm[0].m_sit->m_id;
|
|
|
+ card->m_last_site_dir = lm[0].m_sit->m_pdoa_direction;
|
|
|
+ card->m_last_point.x = lp.x;
|
|
|
+ card->m_last_point.y = lp.y;
|
|
|
+ lp.m_speed = card->m_speed = speed;
|
|
|
+ card->m_cb_point.push_back(lp);
|
|
|
+ card->m_vtp_dist.push_back(dist);
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+/*
|
|
|
+ * 选择一维定位的解
|
|
|
+ *
|
|
|
+ * 参数
|
|
|
+ * const std::vector<point> vp 可能定位解
|
|
|
+ * const std::vector<loc_message>& lm 定位原始数据集
|
|
|
+ * loc_point& lp 保存最终定位解
|
|
|
+ *
|
|
|
+ * 返回值
|
|
|
+ * true表示成功选解,false表示选解失败
|
|
|
+ *
|
|
|
+ * */
|
|
|
bool select_point_object::select_pdoa_1d_solution(const std::vector<point> vp, const std::vector<loc_message>& lm, loc_point& lp)
|
|
|
{
|
|
|
uint64_t id = lm[0].m_card_type;
|