Commit 046e5fb8 authored by limingbo's avatar limingbo

change filter by position stratgy and add startTime and endTime

parent b3ec79fe
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.5.2, 2023-02-09T13:22:15. --> <!-- Written by QtCreator 4.5.2, 2023-02-09T16:55:42. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
......
This diff is collapsed.
...@@ -10,6 +10,8 @@ struct TaskInfo{ ...@@ -10,6 +10,8 @@ struct TaskInfo{
string trajPath = ""; string trajPath = "";
string meshOutPath = ""; string meshOutPath = "";
uint32_t meshId = 0; uint32_t meshId = 0;
double startTime = 0;
double endTime = 0;
}; };
struct CloseTrajInfo{ struct CloseTrajInfo{
...@@ -46,7 +48,7 @@ bool checkMeshOut( ...@@ -46,7 +48,7 @@ bool checkMeshOut(
vector<CloseTrajInfo> crossFilter( vector<CloseTrajInfo> crossFilter(
const vector<TaskInfo> &filteredTaskInfo); const vector<TaskInfo> &filteredTaskInfo);
bool initTrajectory(const string &trajPath, bool initTrajectory(const TaskInfo &taskInfo,
boost::shared_ptr<Trajectory> &trajectory); boost::shared_ptr<Trajectory> &trajectory);
vector<PointCloudExport::Ptr> multiThreadGetPointCloud( vector<PointCloudExport::Ptr> multiThreadGetPointCloud(
......
...@@ -21,8 +21,10 @@ Trajectory::~Trajectory() ...@@ -21,8 +21,10 @@ Trajectory::~Trajectory()
if(io_) delete io_; if(io_) delete io_;
} }
bool Trajectory::init() bool Trajectory::init(double startTime, double endTime)
{ {
startTime_ = startTime;
endTime_ = endTime;
string range; string range;
switch(trajType_){ switch(trajType_){
case PPK: case PPK:
...@@ -303,9 +305,6 @@ bool Trajectory::checkSatisfied(const int32_t &supposed_floor_index, const doubl ...@@ -303,9 +305,6 @@ bool Trajectory::checkSatisfied(const int32_t &supposed_floor_index, const doubl
} }
} }
double gpsToUtc(const uint32_t &gps_week, const double &gps_sec) {
return (315936000 + gps_week*7*24*3600 + gps_sec - 18);
}
void Trajectory::parseAndPush(const vector<string> &vec, uint8_t index) void Trajectory::parseAndPush(const vector<string> &vec, uint8_t index)
{ {
...@@ -350,11 +349,13 @@ void Trajectory::parseAndPush(const vector<string> &vec, uint8_t index) ...@@ -350,11 +349,13 @@ void Trajectory::parseAndPush(const vector<string> &vec, uint8_t index)
trajPoint.rotation = EulerToMatrix3d(Vector3d(ppk_raw_info.pitch, ppk_raw_info.roll, ppk_raw_info.yaw)); trajPoint.rotation = EulerToMatrix3d(Vector3d(ppk_raw_info.pitch, ppk_raw_info.roll, ppk_raw_info.yaw));
trajPoint.nodeId = trajectory_.size(); trajPoint.nodeId = trajectory_.size();
trajPoint.timestamp = gpsToUtc(ppk_raw_info.gps_week, ppk_raw_info.gps_sec); trajPoint.timestamp = gpsToUtc(ppk_raw_info.gps_week, ppk_raw_info.gps_sec);
if(multiTrajectory_[index].size() == 0){ if(trajPoint.timestamp > startTime_ && trajPoint.timestamp < endTime_){
multiTrajectory_[index].push_back(trajPoint); if(multiTrajectory_[index].size() == 0){
}else{
if((trajPoint.translation - multiTrajectory_[index].back().translation).norm() > 1){
multiTrajectory_[index].push_back(trajPoint); multiTrajectory_[index].push_back(trajPoint);
}else{
if((trajPoint.translation - multiTrajectory_[index].back().translation).norm() > 1){
multiTrajectory_[index].push_back(trajPoint);
}
} }
} }
......
...@@ -16,7 +16,7 @@ public: ...@@ -16,7 +16,7 @@ public:
~Trajectory(); ~Trajectory();
bool init(); bool init(double startTime, double endTime);
string getTrajPath() const; string getTrajPath() const;
...@@ -47,6 +47,10 @@ public: ...@@ -47,6 +47,10 @@ public:
Vector3d reverse(const TrajPoint& trajPoint); Vector3d reverse(const TrajPoint& trajPoint);
double getFrequency(); double getFrequency();
static double gpsToUtc(const uint32_t &gps_week, const double &gps_sec) {
return (315936000 + gps_week*7*24*3600 + gps_sec - 18);
}
private: private:
bool checkSatisfied(const int32_t &supposed_floor_index, const double &timestamp) const; bool checkSatisfied(const int32_t &supposed_floor_index, const double &timestamp) const;
...@@ -67,6 +71,8 @@ private: ...@@ -67,6 +71,8 @@ private:
boost::shared_ptr<LocalCartesian> proj_; boost::shared_ptr<LocalCartesian> proj_;
boost::shared_mutex Mtx_; boost::shared_mutex Mtx_;
double startTime_;
double endTime_;
}; };
#endif // TRAJECTORY_H #endif // TRAJECTORY_H
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