90 {
91 std::string pcd_folder = FLAGS_pcd_path;
92 std::vector<std::string> pcd_file_names;
94 AERROR <<
"pcd_folder: " << pcd_folder <<
" get file list error.";
95 return false;
96 }
97
98 std::sort(pcd_file_names.begin(), pcd_file_names.end(),
99 [](const std::string& lhs, const std::string& rhs) {
100 if (lhs.length() != rhs.length()) {
101 return lhs.length() < rhs.length();
102 }
103 return lhs <= rhs;
104 });
105
106 for (size_t i = 0; i < pcd_file_names.size(); ++i) {
107 AINFO <<
"***************** Frame " << i <<
" ******************";
108 AINFO << pcd_file_names[i];
109
111 if (frame->cloud == nullptr) {
112 frame->cloud = base::PointFCloudPool::Instance().Get();
113 }
114 if (frame->world_cloud == nullptr) {
115 frame->world_cloud = base::PointDCloudPool::Instance().Get();
116 }
117 LoadPCLPCD(pcd_file_names[i], frame->cloud.get());
118
119 TransformCloud(frame->cloud, frame->lidar2world_pose, frame->world_cloud);
120 AINFO <<
"Read point cloud from " << pcd_file_names[i]
121 << " with cloud size: " << frame->cloud->size();
122
123 GroundDetectorOptions ground_detector_options;
125 AERROR <<
"Ground detect error.";
126 return false;
127 }
128
129 std::string output_path = FLAGS_output_path;
130 SavePCD(i, frame.get(), output_path);
131 }
132
133 return true;
134 }
static ConcurrentObjectPool & Instance()
std::shared_ptr< ObjectType > Get() override
bool SavePCD(size_t frame_id, LidarFrame *frame, const std::string &path)
bool TransformCloud(const base::PointFCloudPtr &local_cloud, const Eigen::Affine3d &pose, base::PointDCloudPtr world_cloud) const
bool GetFileList(const std::string &path, const std::string &suffix, std::vector< std::string > *files)
bool LoadPCLPCD(const std::string &file_path, base::PointFCloud *cloud_out)