45 const std::shared_ptr<PointCloud>& point_cloud) {
47 std::shared_ptr<PointCloud> point_cloud_compensated =
48 writer_->AcquireMessage();
49 if (point_cloud_compensated ==
nullptr) {
50 AWARN <<
"compensator fail to getobject, will be new";
51 point_cloud_compensated = std::make_shared<PointCloud>();
52 point_cloud_compensated->mutable_point()->Reserve(140000);
54 if (point_cloud_compensated ==
nullptr) {
55 AWARN <<
"compensator point_cloud is nullptr";
58 point_cloud_compensated->Clear();
59 if (compensator_->MotionCompensation(point_cloud, point_cloud_compensated)) {
61 const auto diff = end_time - start_time;
62 const auto meta_diff =
63 end_time -
Time(point_cloud_compensated->header().lidar_timestamp());
64 AINFO <<
"compenstator diff (ms):" << (diff.ToNanosecond() / 1e6)
66 << point_cloud_compensated->header().lidar_timestamp()
67 <<
";meta diff (ms): " << (meta_diff.ToNanosecond() / 1e6);
70 point_cloud_compensated->header().lidar_timestamp(), start_time,
73 point_cloud_compensated->mutable_header()->set_sequence_num(seq_);
74 writer_->Write(point_cloud_compensated);