|
@@ -271,6 +271,21 @@ Card::~Card(void)
|
|
|
m_pKalmanFilter = NULL;
|
|
|
}
|
|
|
#endif
|
|
|
+
|
|
|
+ if(p_dists){
|
|
|
+ delete[] p_dists;
|
|
|
+ p_dists = NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(p_dists_locate){
|
|
|
+ delete[] p_dists_locate;
|
|
|
+ p_dists_locate = NULL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(p3_anchors){
|
|
|
+ delete[] p3_anchors;
|
|
|
+ p3_anchors = NULL;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void Card::get_coordinate_2d( int cnt )
|
|
@@ -629,6 +644,7 @@ void Card::get_coordinate( int cnt )
|
|
|
ReceiveDataMap pRdm;
|
|
|
pRdm.clear();
|
|
|
int t = 0;
|
|
|
+ double synmNumTime = (this->sync_num - this->last_locate.tt)*0.2;
|
|
|
bool bRet = false;
|
|
|
//for(it;it!=_dists.front()->mp_dist.end();it++){
|
|
|
for(int i=0;i<k;i++){
|
|
@@ -643,10 +659,10 @@ void Card::get_coordinate( int cnt )
|
|
|
bRet = true;
|
|
|
break;
|
|
|
}
|
|
|
- if(prd->rec_time_stamp == 806418238616){
|
|
|
+ /*if(prd->rec_time_stamp == 806418238616){
|
|
|
t = 55;
|
|
|
t = p_dists_locate[i]->t;
|
|
|
- }
|
|
|
+ }*/
|
|
|
pRdm.insert(ReceiveDataMap::value_type(prd->reader_id,*prd));
|
|
|
}
|
|
|
}
|
|
@@ -671,6 +687,7 @@ void Card::get_coordinate( int cnt )
|
|
|
//this->m_pKalmanFilter->m_nCounts++;
|
|
|
}else{
|
|
|
this->m_pKalmanFilter->m_bFlag = true;
|
|
|
+ this->m_pKalmanFilter->m_nCounts++;
|
|
|
long long deltaT = this->t - this->last_locate.t;
|
|
|
double vx = 0;
|
|
|
double vy = 0;
|
|
@@ -697,9 +714,9 @@ void Card::get_coordinate( int cnt )
|
|
|
}else{
|
|
|
//只有三次以上才允许使用kalman滤波以下的函数
|
|
|
if(this->m_pKalmanFilter->m_bFlag){
|
|
|
- this->m_pKalmanFilter->Predict_Correct();
|
|
|
+ this->m_pKalmanFilter->Predict_Correct(synmNumTime);
|
|
|
}else{
|
|
|
- this->m_pKalmanFilter->Predict();
|
|
|
+ this->m_pKalmanFilter->Predict(synmNumTime);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -707,6 +724,8 @@ void Card::get_coordinate( int cnt )
|
|
|
this->last_locate.x = this->x = this->m_pKalmanFilter->m_pCar->x(0,1);
|
|
|
this->last_locate.y = this->y = this->m_pKalmanFilter->m_pCar->x(2,1);
|
|
|
this->last_locate.z = this->z;
|
|
|
+ this->last_locate.t = this->t;
|
|
|
+ this->last_locate.tt = this->sync_num;
|
|
|
this->v = sqrt(pow(this->m_pKalmanFilter->m_pCar->x(1,1),2) + pow(this->m_pKalmanFilter->m_pCar->x(3,1),2));
|
|
|
#else
|
|
|
//最新通过算法算出的结果
|