From 0f3da9994c71db04cbff9fc5ca06c8d17524d500 Mon Sep 17 00:00:00 2001 From: waiwaylee Date: Thu, 29 Oct 2026 14:24:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A1=E3=80=81=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=88=AA=E8=BF=B9=E6=8C=87=E7=BA=B9=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=EF=BC=8CTAS=E6=8E=A7=E5=88=B6=E5=91=BD=E4=BB=A4=E4=B8=8B?= =?UTF-8?q?=E5=8F=91=E8=88=AA=E8=BF=B9=E6=8C=87=E7=BA=B9=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E4=B8=8B=E5=8F=91=E6=89=B9=E5=8F=B7=EF=BC=8C=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0TAS=E6=AD=A3=E5=B8=B8=E5=9B=9E=E6=94=BE=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: waiwaylee --- data_process_class_dll/data_process.cpp | 18 +++++-- data_process_class_dll/data_process.h | 2 +- data_process_class_dll/struct.h | 1 + data_process_class_dll/tas_ctrl.cpp | 4 +- data_process_class_dll/track_init.cpp | 65 ++++++++++++++++++------- data_process_class_dll/track_init.h | 7 +++ 6 files changed, 72 insertions(+), 25 deletions(-) diff --git a/data_process_class_dll/data_process.cpp b/data_process_class_dll/data_process.cpp index f6cb1c4..f5e2f0c 100644 --- a/data_process_class_dll/data_process.cpp +++ b/data_process_class_dll/data_process.cpp @@ -97,11 +97,8 @@ int Data_Process::data_preprocess(struct DataRev Data_Input[150]) } else if(Data_Input[0].point_type == 1) //tas数据 { - // std::cout << "TAS TARGET :" < rec_points; @@ -209,6 +206,17 @@ int model) *Trust_track_num_Output=0; //航迹更新数 *Track_die_num_Output=0; //航迹消亡数目 + //查找指定指纹的Track_idx + int tas_track_idx = -1; + for(auto& t : trust_track){ + if(t.Track_fingerprint == TAS_track_fingerprint){ + tas_track_idx = t.Track_Index; + t.manual_tracking_flag = 1; + t.Track_Mode = 1; + break; + } + } + dot_coh_tas.dot_coh_tas_process(&Data_buffer_tas,&point_recv_tas); //点迹凝聚 std::vector().swap(Data_buffer_tas);//凝聚完毕 清除Data_buffer @@ -217,7 +225,7 @@ int model) &trust_track, //航迹文件 Trust_Track_Output, //更新航迹信息 Trust_track_num_Output, //更新航迹数 - TAS_track_idx, + tas_track_idx, latest_timestamp //最新时间戳 ); diff --git a/data_process_class_dll/data_process.h b/data_process_class_dll/data_process.h index 5fe0724..e99fba1 100644 --- a/data_process_class_dll/data_process.h +++ b/data_process_class_dll/data_process.h @@ -90,7 +90,7 @@ private: int beam_index[3]; //3个波位号(当前帧) - int TAS_track_idx; //TAS数据的目标批号 + int TAS_track_fingerprint; //TAS数据的目标批号 int Track_Mode; //跟踪模式 1TAS 0TWS diff --git a/data_process_class_dll/struct.h b/data_process_class_dll/struct.h index df8bcbe..dccfda6 100644 --- a/data_process_class_dll/struct.h +++ b/data_process_class_dll/struct.h @@ -44,6 +44,7 @@ struct Trust_Track long long circle_id; //处理圈数ID int Track_Index; //航迹号 + int Track_fingerprint; //航迹指纹 double Range; //距离 double Azimuth; //方位 diff --git a/data_process_class_dll/tas_ctrl.cpp b/data_process_class_dll/tas_ctrl.cpp index 97f843e..edffd07 100644 --- a/data_process_class_dll/tas_ctrl.cpp +++ b/data_process_class_dll/tas_ctrl.cpp @@ -300,10 +300,10 @@ void TAS_Ctrl::tas_beam_output(std::vector *trust_track Tracking_beam->type=rdp_parameter.default_track_beam_type; //跟踪目标批号 - Tracking_beam->TAS_track_index = (*trust_track)[earliest_track_idx].Track_Index; + Tracking_beam->TAS_track_index = (*trust_track)[earliest_track_idx].Track_fingerprint; //跟踪波束开关开启 Tracking_beam->open_flag=1; - //RDP_LOG_DEBUG("TAS <{}> output: range: {} azi: {} pit: {}", (*trust_track)[earliest_track_idx].Track_Index, Tracking_beam->Range, Tracking_beam->Azi, Tracking_beam->Elev); + // RDP_LOG_INFO("TAS <{}> output: range: {} azi: {} pit: {}", Tracking_beam->TAS_track_index, Tracking_beam->Range, Tracking_beam->Azi, Tracking_beam->Elev); } diff --git a/data_process_class_dll/track_init.cpp b/data_process_class_dll/track_init.cpp index f583dcc..1386f90 100644 --- a/data_process_class_dll/track_init.cpp +++ b/data_process_class_dll/track_init.cpp @@ -484,23 +484,6 @@ void Track_Init::tmp_track_to_trust_track(std::vector *trust_tra double azi=(*Iter)[L-1].azi/PI*180; double quality = (*Iter)[L-1].quality; - // //计算航迹初始质量 - // double average_snr = 0; - // for(int i=0;i *trust_tra Trust_Track trust_track_tmp = {}; memcpy(trust_track_tmp.X, X, 6*sizeof(double)); memcpy(trust_track_tmp.P, P, 6*6*sizeof(double)); + + //计算航迹指纹 + trust_track_tmp.Track_fingerprint = computeFingerprint(Track_to_start[i][L-1].r, Track_to_start[i][L-1].azi, Track_to_start[i][L-1].vr, Track_to_start[i][L-1].RCS, Track_to_start[i][L-1].CPI_time); trust_track_tmp.track_id = Track_to_start[i][L-1].temp_track_id; trust_track_tmp.point_id = Track_to_start[i][L-1].point_id; @@ -794,6 +780,51 @@ int Track_Init::track_init_prohibit(double r, double azi) } +uint64_t Track_Init::mix64(uint64_t x) { + x ^= x >> 30; x *= 0xBF58476D1CE4E5B9ULL; + x ^= x >> 27; x *= 0x94D049BB133111EBULL; + x ^= x >> 31; + return x; +} + +uint64_t Track_Init::quantize(double v, double scale) { + if (std::isnan(v)) return 0x9E3779B97F4A7C15ULL; + if (std::isinf(v)) + return v > 0 ? 0x2C08A6D5E3F1B907ULL : 0xD5E3F1B9072C08A6ULL; + + double q = std::round(v * scale); // half away from zero + constexpr double kLim = 9.0e18; // < 2^63,避免转 int64 溢出 + if (q > kLim) q = kLim; + if (q < -kLim) q = -kLim; + return static_cast(static_cast(q)); +} + +uint64_t Track_Init::bits_of(double v) { + if (std::isnan(v)) return 0x7FF8000000000000ULL; + if (v == 0.0) return 0ULL; + uint64_t b; + std::memcpy(&b, &v, sizeof(b)); + return b; +} + +uint16_t Track_Init::fold16(uint64_t h) { + h ^= h >> 32; + h ^= h >> 16; + return static_cast(h); +} + +uint16_t Track_Init::computeFingerprint(double r, double azi, double vr, double RCS, + long long CPI_time) +{ + uint64_t h = kSeed; + h = mix64(h ^ quantize(r, 100.0)); // 距离:保留 0.01 m + h = mix64(h ^ quantize(azi, 1000.0)); // 方位:保留 0.001° + h = mix64(h ^ quantize(vr, 100.0)); // 径向速度:保留 0.01 m/s + h = mix64(h ^ quantize(RCS, 10.0)); // RCS:保留 0.1 dBsm + h = mix64(h ^ static_cast(CPI_time)); + return fold16(h); +} + Track_Init::Track_Init() { diff --git a/data_process_class_dll/track_init.h b/data_process_class_dll/track_init.h index c41fd9e..0135405 100644 --- a/data_process_class_dll/track_init.h +++ b/data_process_class_dll/track_init.h @@ -45,6 +45,13 @@ private: int track_init_prohibit(double r, double azi); //判断目标是否位于航迹起始屏蔽区 是返回1 否返回0 + const uint64_t kSeed = 0x243F6A8885A308D3ULL; + uint64_t mix64(uint64_t x); // splitmix64 混合函数:对任意 64bit 输入产生雪崩均匀的 64bit 输出 + uint64_t quantize(double v, double scale); // 量化:把 double 映射到整数域,可容忍 ±0.5/scale 的浮点噪声 + uint64_t bits_of(double v); // bit-exact:直接使用 IEEE754 位模式(-0.0 归一为 +0.0,NaN 归一) + uint16_t fold16(uint64_t h); // 把 64bit 折叠成 16bit,充分使用全部熵 + uint16_t computeFingerprint(double r, double azi, double vr, double RCS, long long CPI_time); //计算航迹指纹 + Track_Ind_Mangement track_index_mangement; };