Commit 843fe0a5 authored by wangdawei's avatar wangdawei

filter period time < 2sec

parent a96a2b23
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.11.1, 2023-06-26T19:12:39. --> <!-- Written by QtCreator 4.11.1, 2023-08-01T17:10:35. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
......
...@@ -532,9 +532,18 @@ vector<CloseTrajInfo> crossFilter( ...@@ -532,9 +532,18 @@ vector<CloseTrajInfo> crossFilter(
} }
} }
filterByPosition(ret, pointClouds, trajectories); filterByPosition(ret, pointClouds, trajectories);
vector<CloseTrajInfo> retOver2Sec;
for(size_t retIndex = 0; retIndex < ret.size(); retIndex++){ for(size_t retIndex = 0; retIndex < ret.size(); retIndex++){
const auto& oneRet = ret.at(retIndex); const auto& oneRet = ret.at(retIndex);
CloseTrajInfo oneRetOver2Sec;
oneRetOver2Sec.index = oneRet.index;
oneRetOver2Sec.trajPath = oneRet.trajPath;
for(size_t periodIndex = 0; periodIndex < oneRet.periods.size(); periodIndex++){ for(size_t periodIndex = 0; periodIndex < oneRet.periods.size(); periodIndex++){
auto period = oneRet.periods.at(periodIndex);
if(period.second - period.first < 2){
continue;
}
oneRetOver2Sec.periods.push_back(period);
size_t indexOffset; size_t indexOffset;
PointCloudExport periodCloud = PointCloudExport periodCloud =
getCloudFromPeriod(pointClouds.at(oneRet.index), oneRet.periods.at(periodIndex), indexOffset); getCloudFromPeriod(pointClouds.at(oneRet.index), oneRet.periods.at(periodIndex), indexOffset);
...@@ -544,7 +553,11 @@ vector<CloseTrajInfo> crossFilter( ...@@ -544,7 +553,11 @@ vector<CloseTrajInfo> crossFilter(
".pcd", periodCloud); ".pcd", periodCloud);
} }
} }
if(oneRetOver2Sec.periods.size()){
retOver2Sec.push_back(oneRetOver2Sec);
}
} }
retOver2Sec.swap(ret);
return ret; return ret;
} }
......
...@@ -68,7 +68,11 @@ int main(int argc, char *argv[]) ...@@ -68,7 +68,11 @@ int main(int argc, char *argv[])
}); });
ofs << meshId; ofs << meshId;
for(auto period : task.periods){ for(auto period : task.periods){
ofs << setprecision(15) << " " << period.first << " " << period.second - period.first; auto timeDelta = period.second - period.first;
if(timeDelta < 2){
continue;
}
ofs << setprecision(15) << " " << period.first << " " << timeDelta;
} }
ofs << std::endl; ofs << std::endl;
......
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