|
@@ -140,7 +140,7 @@ struct person_point_filter:select_point_object
|
|
return a;
|
|
return a;
|
|
}
|
|
}
|
|
|
|
|
|
- virtual bool revise_by_history(point & pt, const site*sit, int64_t m_time)
|
|
|
|
|
|
+ virtual bool revise_by_history(point & pt, const site*sit, int64_t timestamp)
|
|
{
|
|
{
|
|
point dstp = sit->get_dstp(pt);
|
|
point dstp = sit->get_dstp(pt);
|
|
if(dstp.empty())
|
|
if(dstp.empty())
|
|
@@ -468,12 +468,13 @@ struct car_point_filter:select_point_object
|
|
return dist;
|
|
return dist;
|
|
}
|
|
}
|
|
|
|
|
|
- virtual bool revise_by_history(point & pt, const site*sit, int64_t m_time)
|
|
|
|
|
|
+ virtual bool revise_by_history(point & pt, const site*sit, int64_t timestamp)
|
|
{
|
|
{
|
|
- std_info("revise_____-before:%f,%f",pt.x,pt.y);
|
|
|
|
|
|
+ std_info("revise_____-before:%f,%f,%llu",pt.x,pt.y,timestamp);
|
|
bool flag =false;
|
|
bool flag =false;
|
|
if(m_line.empty() || !m_line.contain(m_d(0),0.1))
|
|
if(m_line.empty() || !m_line.contain(m_d(0),0.1))
|
|
{
|
|
{
|
|
|
|
+ std_info("m_line .empty() ......");
|
|
m_last_fit_valid = false;
|
|
m_last_fit_valid = false;
|
|
m_last_fit_time_sec = 0;
|
|
m_last_fit_time_sec = 0;
|
|
m_last_fit_k = 0;
|
|
m_last_fit_k = 0;
|
|
@@ -493,7 +494,7 @@ struct car_point_filter:select_point_object
|
|
|
|
|
|
// convert pt to distance
|
|
// convert pt to distance
|
|
double dist = convert_pt_to_dist(pt, sit);
|
|
double dist = convert_pt_to_dist(pt, sit);
|
|
- double m_time_sec = m_time / 1000.; //second
|
|
|
|
|
|
+ double m_time_sec = timestamp / 1000.; //second
|
|
//if(m_time_sec - m_last_fit_nearest_time_sec > 30)m_last_fit_valid = false;
|
|
//if(m_time_sec - m_last_fit_nearest_time_sec > 30)m_last_fit_valid = false;
|
|
if(m_time_sec - m_last_fit_time_sec > 60)m_last_fit_valid = false;
|
|
if(m_time_sec - m_last_fit_time_sec > 60)m_last_fit_valid = false;
|
|
|
|
|
|
@@ -503,6 +504,10 @@ struct car_point_filter:select_point_object
|
|
// choose data by fit
|
|
// choose data by fit
|
|
const fit_result*fit=best_fit();
|
|
const fit_result*fit=best_fit();
|
|
bool if_change_fit=false;
|
|
bool if_change_fit=false;
|
|
|
|
+ if(fit !=nullptr)
|
|
|
|
+ std_info("fit != nullptr...m_time_sec:%f,fitK.x():%f",m_time_sec,m_fitk.x(0));
|
|
|
|
+ else
|
|
|
|
+ std_info("fit ==nullptr...");
|
|
if(fit!=nullptr && fit->ke<=1 && m_time_sec - m_fitk.x(0) <= 15 && fabs(fit->k) < m_pos_differ)
|
|
if(fit!=nullptr && fit->ke<=1 && m_time_sec - m_fitk.x(0) <= 15 && fabs(fit->k) < m_pos_differ)
|
|
{ //printf("change fit time:%f,%f,%f\n",m_time_sec, fit->d.x(0), m_time_sec - fit->d.x(0));
|
|
{ //printf("change fit time:%f,%f,%f\n",m_time_sec, fit->d.x(0), m_time_sec - fit->d.x(0));
|
|
|
|
|
|
@@ -549,7 +554,7 @@ struct car_point_filter:select_point_object
|
|
// update acc
|
|
// update acc
|
|
//m_accumulate_acc=0
|
|
//m_accumulate_acc=0
|
|
|
|
|
|
- printf("change line, k=%f,ke=%f\n",fit->k,fit->ke);
|
|
|
|
|
|
+ printf("change line------------, k=%f,ke=%f\n",fit->k,fit->ke);
|
|
}
|
|
}
|
|
|
|
|
|
// revise
|
|
// revise
|
|
@@ -558,6 +563,7 @@ struct car_point_filter:select_point_object
|
|
//estimate_dist, dist, m_last_fit_valid, m_time_sec - m_last_fit_time_sec);
|
|
//estimate_dist, dist, m_last_fit_valid, m_time_sec - m_last_fit_time_sec);
|
|
if(m_last_fit_valid && m_time_sec - m_last_fit_time_sec < 20)
|
|
if(m_last_fit_valid && m_time_sec - m_last_fit_time_sec < 20)
|
|
{
|
|
{
|
|
|
|
+ std_info("here ....m_time_sec:%llu,m_last_fit_time_sec:%llu",m_time_sec,m_last_fit_time_sec);
|
|
if(fabs(m_last_fit_k) > 0.5 && fabs(estimate_dist-dist)>m_fit_differ)
|
|
if(fabs(m_last_fit_k) > 0.5 && fabs(estimate_dist-dist)>m_fit_differ)
|
|
dist=estimate_dist;
|
|
dist=estimate_dist;
|
|
else if(fabs(m_last_fit_k) <= 0.5 && fabs(estimate_dist-dist)>m_fit_differ * 2)
|
|
else if(fabs(m_last_fit_k) <= 0.5 && fabs(estimate_dist-dist)>m_fit_differ * 2)
|
|
@@ -576,7 +582,7 @@ struct car_point_filter:select_point_object
|
|
|
|
|
|
// create the list
|
|
// create the list
|
|
//if(m_accumulate_acc<-10)generate(mpt, sit,false); generate single point
|
|
//if(m_accumulate_acc<-10)generate(mpt, sit,false); generate single point
|
|
- if(m_last_fit_valid && m_time/1000. - m_last_fit_time_sec < 20 && fabs(m_last_fit_k) > 0.5)
|
|
|
|
|
|
+ if(m_last_fit_valid && timestamp/1000. - m_last_fit_time_sec < 20 && fabs(m_last_fit_k) > 0.5)
|
|
generate_list(mpt, sit, true); //generate the whole list
|
|
generate_list(mpt, sit, true); //generate the whole list
|
|
else
|
|
else
|
|
generate_list(mpt, sit, false); //generate single point
|
|
generate_list(mpt, sit, false); //generate single point
|
|
@@ -1066,22 +1072,22 @@ struct select_tool_manage
|
|
{
|
|
{
|
|
void create_tool(const std::string &s,std::shared_ptr<select_tool> &set,std::shared_ptr<smooth_tool> &smt)
|
|
void create_tool(const std::string &s,std::shared_ptr<select_tool> &set,std::shared_ptr<smooth_tool> &smt)
|
|
{
|
|
{
|
|
- if(s.compare(std::string{"person1"}))
|
|
|
|
|
|
+ if(!s.compare(std::string{"person1"}))
|
|
{
|
|
{
|
|
set=std::make_shared<select_tool_person_1>();
|
|
set=std::make_shared<select_tool_person_1>();
|
|
smt=std::make_shared<smooth_tool_person_1>(set);
|
|
smt=std::make_shared<smooth_tool_person_1>(set);
|
|
}
|
|
}
|
|
- else if(s.compare(std::string{"person2"}))
|
|
|
|
|
|
+ else if(!s.compare(std::string{"person2"}))
|
|
{
|
|
{
|
|
set=std::make_shared<select_tool_person_2>();
|
|
set=std::make_shared<select_tool_person_2>();
|
|
smt=std::make_shared<smooth_tool_person_1>(set);
|
|
smt=std::make_shared<smooth_tool_person_1>(set);
|
|
}
|
|
}
|
|
- else if(s.compare(std::string{"car1"}))
|
|
|
|
|
|
+ else if(!s.compare(std::string{"car1"}))
|
|
{
|
|
{
|
|
set=std::make_shared<select_tool_car_1>();
|
|
set=std::make_shared<select_tool_car_1>();
|
|
smt=std::make_shared<smooth_tool_car_1>(set);
|
|
smt=std::make_shared<smooth_tool_car_1>(set);
|
|
}
|
|
}
|
|
- else if(s.compare(std::string{"drivingface1"}))
|
|
|
|
|
|
+ else if(!s.compare(std::string{"drivingface1"}))
|
|
{
|
|
{
|
|
set=std::make_shared<select_tool_drivingface_car_1>();
|
|
set=std::make_shared<select_tool_drivingface_car_1>();
|
|
smt=std::make_shared<smooth_tool_drivingface_car_1>(set);
|
|
smt=std::make_shared<smooth_tool_drivingface_car_1>(set);
|