Skip to content
Snippets Groups Projects
Commit e8959f56 authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

Now it removes also features when relocalization. Added clear of landmarks

parent 8fd6a0a4
Branches master
No related tags found
No related merge requests found
...@@ -64,6 +64,7 @@ bool AdcLandmarksSlamSolverAlgorithm::load_landmarks(const std::string& _landmar ...@@ -64,6 +64,7 @@ bool AdcLandmarksSlamSolverAlgorithm::load_landmarks(const std::string& _landmar
if (!landmarks_file.good()) if (!landmarks_file.good())
return false; return false;
std::map<double, LandmarkInfo>().swap(this->landmarks_); std::map<double, LandmarkInfo>().swap(this->landmarks_);
this->landmarks_.clear();
//Read the file //Read the file
double id, l1, l2, l3; double id, l1, l2, l3;
int t; int t;
...@@ -97,6 +98,7 @@ bool AdcLandmarksSlamSolverAlgorithm::load_from_xodr(const std::string& _landmar ...@@ -97,6 +98,7 @@ bool AdcLandmarksSlamSolverAlgorithm::load_from_xodr(const std::string& _landmar
road.set_min_road_length(0.01); road.set_min_road_length(0.01);
road.load(_landmarks_file); road.load(_landmarks_file);
std::map<double, LandmarkInfo>().swap(this->landmarks_); std::map<double, LandmarkInfo>().swap(this->landmarks_);
this->landmarks_.clear();
for(unsigned int i=0;i<road.get_num_segments();i++) for(unsigned int i=0;i<road.get_num_segments();i++)
{ {
......
...@@ -264,6 +264,12 @@ void AdcLandmarksSlamSolverAlgNode::mainNodeThread(void) ...@@ -264,6 +264,12 @@ void AdcLandmarksSlamSolverAlgNode::mainNodeThread(void)
//Remove candidates //Remove candidates
std::list<LandmarkCandidate>().swap(this->landmarks_candidates_); std::list<LandmarkCandidate>().swap(this->landmarks_candidates_);
this->landmarks_candidates_.clear(); this->landmarks_candidates_.clear();
std::vector<FeatureInfo>().swap(this->front_features_);
this->front_features_.clear();
std::vector<FeatureInfo>().swap(this->rear_features_);
this->rear_features_.clear();
std::vector<FeatureInfo>().swap(this->features_);
this->features_.clear();
this->new_initialpose_ = false; this->new_initialpose_ = false;
this->new_estimated_pose_ = true; this->new_estimated_pose_ = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment