更新:1、kalman_filter_init_2dots函数中量测噪声协方差矩阵R中R[1][0]赋值错误;

2、数据预处理中波位号判断规则修改;
3、数据预处理中增加点迹数量限制,避免超过数组上限;
4、Dot_Coh_TAS::dot_coh_tas_process中增加容器非空判断;
5、d_cal_with_doppler中计算雅可比矩阵改为用预测值计算;
6、tmp_track_to_trust_track中数组索引为负的问题修复;
7、tmp_track_to_trust_track中对容器push_back后在修改元素可能导致无法修改容器中的元素;
8、修改部分参数,适配机扫模式;

Signed-off-by: waiwaylee <waiwaylee@foxmail.com>
This commit is contained in:
2026-07-06 14:21:49 +08:00
parent 28fcf06060
commit e9b8a3245a
9 changed files with 25 additions and 21 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ int Data_Process::data_preprocess(struct DataRev Data_Input[150])
//数据存入缓存区域 Data_buffer
if(Data_Input[0].point_type == 0) //tws数据
{
data_num=Data_Input[0].Point_Sum;
data_num=min(Data_Input[0].Point_Sum, 150);
TAS_track_idx = Data_Input[0].TAS_track_index;
for (int i=0; i<data_num;i++)
{
@@ -42,7 +42,7 @@ int Data_Process::data_preprocess(struct DataRev Data_Input[150])
Data_buffer.push_back(Data_buffer_temp);
}
if(Data_Input[0].Beam_index_aiz == 16) //TWS
if(Data_Input[0].Beam_index_aiz % 16 == 0) //TWS
{
return 1;
}
@@ -16,6 +16,7 @@ struct DATA_PROCESS_CLASS_DLLSHARED_EXPORT DataRev
float Threshold; //目标门限
float Snr; //目标信噪比
float RCS; //目标RCS
float Encoder_value; //码盘值
int CPI_time; //CPI时间 该波位无点迹输入时也需要给出当前时间
int Beam_index_azi_0; //上一个cpi波位
int Beam_index_aiz; //方位波位号(0-24) 该波位无输入点迹时 也需要给出当前波位
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.0.2, 2026-06-25T15:53:21. -->
<!-- Written by QtCreator 4.0.2, 2026-06-30T13:50:16. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
+3 -1
View File
@@ -10,7 +10,9 @@ int Dot_Coh_TAS::dot_coh_tas_process(QVector <PointRecv> *data_in
QVector <PointRecv> *point_recv_tas //输出点迹
)
{
if (data_input->size() == 0) {
return 1;
}
for (int loop_of_point=0; loop_of_point<data_input->size()-1;loop_of_point++ )
{
+5 -5
View File
@@ -29,7 +29,7 @@ void kalman:: kalman_filter_init_2dots(double Z0[2], double Z1[2], double T,doub
R[0][0]=(pow(lambda_theta,-2)-2)*rho*rho*cos(theta)*cos(theta)+0.5*(rho*rho+SIGMA_R*SIGMA_R)*(1+lambda_theta1*cos(2*theta));
R[1][1]=(pow(lambda_theta,-2)-2)*rho*rho*sin(theta)*sin(theta)+0.5*(rho*rho+SIGMA_R*SIGMA_R)*(1-lambda_theta1*cos(2*theta));
R[0][1]=(pow(lambda_theta,-2)-2)*rho*rho*sin(theta)*cos(theta)+0.5*(rho*rho+SIGMA_R*SIGMA_R)*lambda_theta1*sin(2*theta);
R[1][0]=R[1][1];
R[1][0]=R[0][1];
P[0][0]=R[0][0];
@@ -358,10 +358,10 @@ double kalman:: d_cal_with_doppler(double F[6][6], double Q[6][6] , double Z[2],
//Z(k+1|k)
double x=X[0];
double vx=X[1];
double y=X[3];
double vy=X[4];
double x=X_pred[0];
double vx=X_pred[1];
double y=X_pred[3];
double vy=X_pred[4];
double h31=-y*(vx*y-vy*x)/((x*x+y*y)*sqrt(x*x+y*y));
double h32=-x/sqrt(x*x+y*y);
double h34=-x*(vy*x-vx*y)/((x*x+y*y)*sqrt(x*x+y*y));
+4 -4
View File
@@ -70,7 +70,7 @@
//#define DATA_RATE_MIDDLE 1
//#define DATA_RATE_FAR 1
#define DATA_RATE_TAS 0.3
#define DATA_RATE_TAS 0.33
#define SIGMA_R 10.0 //测量误差
#define SIGMA_A 0.02
@@ -109,9 +109,9 @@
#define H_F_WIN_LEN 3
#define TAS_QUEUE_LENGTH 4 //Tas调用的cpi数
#define MAX_TAS_NUM 4
#define T_TAS_PRED 0.7
#define TAS_QUEUE_LENGTH 1 //Tas调用的cpi数
#define MAX_TAS_NUM 1
#define T_TAS_PRED 0.33
#define UNCONF_TARGET 0
+6 -6
View File
@@ -257,14 +257,14 @@ void TAS_Ctrl::tas_beam_output(QVector<Trust_Track> *trust_track,
double H_track;
double X_now[6];
for (int i=0;i<trust_track->size();i++ )
{
if((*trust_track)[i].Track_Index == tas_target_queue[0].Index)
{
if((*trust_track)[i].Track_Index == tas_target_queue[0].Index)
{
H_track = (*trust_track)[i].Height;
for(int ii=0;ii<6;ii++)
X_now[ii]=(*trust_track)[i].X[ii];
}
H_track = (*trust_track)[i].Height;
for(int ii=0;ii<6;ii++)
X_now[ii]=(*trust_track)[i].X[ii];
}
}
//预测目标位置 计算跟踪波束波位号 俯仰角
+1 -1
View File
@@ -694,7 +694,7 @@ void Track_Init::tmp_track_to_trust_track(QVector<Trust_Track> *trust_track,
Direction_Angle=atan2(Track_to_start[i][j].X[3],Track_to_start[i][j].X[1]);
if(Direction_Angle<0)
Direction_Angle=Direction_Angle+2*PI;
Trust_Track_Output[*Trust_track_num_Output-1][j-1].Direction_Angle=Direction_Angle/PI*180;
Trust_Track_Output[*Trust_track_num_Output-1][j].Direction_Angle=Direction_Angle/PI*180;
@@ -370,13 +370,14 @@ void Track_Init_Direct_Tracking::tmp_track_to_trust_track( QVector<Trust_Track>
memcpy(trust_track_tmp.P2, P, 6*6*sizeof(double));
memcpy(trust_track_tmp.X3, X, 6*sizeof(double));
memcpy(trust_track_tmp.P3, P, 6*6*sizeof(double));
(*trust_track).push_back(trust_track_tmp);
trust_track_tmp.pitch_num = (*Iter)[L-1].pitch_num;
std::memcpy(trust_track_tmp.speed_dim, (*Iter)[L-1].speed_dim, sizeof(trust_track_tmp.speed_dim));
std::memcpy(trust_track_tmp.range_dim, (*Iter)[L-1].range_dim, sizeof(trust_track_tmp.range_dim));
(*trust_track).push_back(trust_track_tmp);
//输出航迹更新信息
*Trust_track_num_Output=*Trust_track_num_Output+1;
for (int j=0;j<L;j++)