Commit fe166c5e authored by wangdawei's avatar wangdawei

map dir

parent b80c1fe2
...@@ -93,7 +93,7 @@ void AdjustPPK::ReadBag(const string &bagPath) ...@@ -93,7 +93,7 @@ void AdjustPPK::ReadBag(const string &bagPath)
void AdjustPPK::ReadCenter() void AdjustPPK::ReadCenter()
{ {
string centerPath = mapDir_ + "/2329_station_jf.txt"; string centerPath = mapDir_ + "/2329/2329_station_jf.txt";
std::ifstream ifs(centerPath); std::ifstream ifs(centerPath);
string line; string line;
vector<string> line_vec; vector<string> line_vec;
...@@ -207,25 +207,52 @@ void AdjustPPK::LoadMapInfo() ...@@ -207,25 +207,52 @@ void AdjustPPK::LoadMapInfo()
// meshVec_.insert(make_pair(ulong(stoi(meshId)), meshMap)); // meshVec_.insert(make_pair(ulong(stoi(meshId)), meshMap));
// } // }
// } // }
string meshDir = mapDir_ + "/pcd_cart"; if(is_directory(mapDir_)){
if(is_directory(meshDir)){ directory_iterator mesh_iter(mapDir_);
directory_iterator pcd_iter(meshDir); directory_iterator mesh_end_iter;
directory_iterator pcd_end_iter; for(; mesh_iter != mesh_end_iter; mesh_iter++) {
for(; pcd_iter != pcd_end_iter; pcd_iter++) { string meshDir = mesh_iter->path().string() + "/pcd_cart";
if(pcd_iter->path().extension().string() != ".pcd"){ if(is_directory(meshDir)){
continue; directory_iterator pcd_iter(meshDir);
} directory_iterator pcd_end_iter;
auto fileName = pcd_iter->path().filename().string(); for(; pcd_iter != pcd_end_iter; pcd_iter++) {
ulong meshId = stoi(split_string(fileName, '_').front()); if(pcd_iter->path().extension().string() != ".pcd"){
if(meshVec_.find(meshId) == meshVec_.end()){ continue;
MashMap meshMap; }
meshMap.pcdPathVec.push_back(pcd_iter->path().string()); auto fileName = pcd_iter->path().filename().string();
meshVec_.insert(make_pair(meshId, meshMap)); ulong meshId = stoi(split_string(fileName, '_').front());
}else{ if(meshVec_.find(meshId) == meshVec_.end()){
meshVec_.at(meshId).pcdPathVec.push_back(pcd_iter->path().string()); MashMap meshMap;
meshMap.pcdPathVec.push_back(pcd_iter->path().string());
meshVec_.insert(make_pair(meshId, meshMap));
}else{
meshVec_.at(meshId).pcdPathVec.push_back(pcd_iter->path().string());
}
}
} }
} }
} }
// string meshDir = mapDir_ + "/pcd_cart";
// if(is_directory(meshDir)){
// directory_iterator pcd_iter(meshDir);
// directory_iterator pcd_end_iter;
// for(; pcd_iter != pcd_end_iter; pcd_iter++) {
// if(pcd_iter->path().extension().string() != ".pcd"){
// continue;
// }
// auto fileName = pcd_iter->path().filename().string();
// ulong meshId = stoi(split_string(fileName, '_').front());
// if(meshVec_.find(meshId) == meshVec_.end()){
// MashMap meshMap;
// meshMap.pcdPathVec.push_back(pcd_iter->path().string());
// meshVec_.insert(make_pair(meshId, meshMap));
// }else{
// meshVec_.at(meshId).pcdPathVec.push_back(pcd_iter->path().string());
// }
// }
// }
LOG(INFO) << "meshVec_.size(): " << meshVec_.size(); LOG(INFO) << "meshVec_.size(): " << meshVec_.size();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment