55 const std::shared_ptr<PointCloud>& point_cloud) {
57 std::shared_ptr<PointCloud> point_cloud_compensated =
58 compensator_pool_->GetObject();
59 if (point_cloud_compensated ==
nullptr) {
60 AWARN <<
"compensator fail to getobject, will be new";
61 point_cloud_compensated = std::make_shared<PointCloud>();
62 point_cloud_compensated->mutable_point()->Reserve(140000);
64 if (point_cloud_compensated ==
nullptr) {
65 AWARN <<
"compensator point_cloud is nullptr";
68 point_cloud_compensated->Clear();
69 if (compensator_->MotionCompensation(point_cloud, point_cloud_compensated)) {
71 const auto diff = end_time - start_time;
72 const auto meta_diff =
73 end_time -
Time(point_cloud_compensated->header().lidar_timestamp());
74 AINFO <<
"compenstator diff (ms):" << (diff.ToNanosecond() / 1e6)
76 << point_cloud_compensated->header().lidar_timestamp()
77 <<
";meta diff (ms): " << (meta_diff.ToNanosecond() / 1e6);
80 point_cloud_compensated->header().lidar_timestamp(), start_time,
83 point_cloud_compensated->mutable_header()->set_sequence_num(seq_);
84 writer_->Write(point_cloud_compensated);