Commit fe166c5e authored by wangdawei's avatar wangdawei

map dir

parent b80c1fe2
......@@ -93,7 +93,7 @@ void AdjustPPK::ReadBag(const string &bagPath)
void AdjustPPK::ReadCenter()
{
string centerPath = mapDir_ + "/2329_station_jf.txt";
string centerPath = mapDir_ + "/2329/2329_station_jf.txt";
std::ifstream ifs(centerPath);
string line;
vector<string> line_vec;
......@@ -207,25 +207,52 @@ void AdjustPPK::LoadMapInfo()
// meshVec_.insert(make_pair(ulong(stoi(meshId)), meshMap));
// }
// }
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());
if(is_directory(mapDir_)){
directory_iterator mesh_iter(mapDir_);
directory_iterator mesh_end_iter;
for(; mesh_iter != mesh_end_iter; mesh_iter++) {
string meshDir = mesh_iter->path().string() + "/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());
}
}
}
}
}
// 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();
}
......
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