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(
70 point_cloud, point_cloud_compensated)) {
72 const auto diff = end_time - start_time;
73 const auto meta_diff = end_time
74 -
Time(point_cloud_compensated->header().lidar_timestamp());
75 AINFO <<
"compenstator diff (ms):" << (diff.ToNanosecond() / 1e6)
77 << point_cloud_compensated->header().lidar_timestamp()
78 <<
";meta diff (ms): " << (meta_diff.ToNanosecond() / 1e6);
81 point_cloud_compensated->header().lidar_timestamp(),
85 point_cloud_compensated->mutable_header()->set_sequence_num(seq_);
86 writer_->Write(point_cloud_compensated);