Apollo 10.0
自动驾驶开放平台
compensator.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2017 The Apollo Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *****************************************************************************/
16
17#pragma once
18
19#include <memory>
20#include <string>
21
22#include "Eigen/Eigen"
23
24// Eigen 3.3.7: #define ALIVE (0)
25// fastrtps: enum ChangeKind_t { ALIVE, ... };
26#if defined(ALIVE)
27#undef ALIVE
28#endif
29
30#include "modules/drivers/lidar/proto/velodyne_config.pb.h"
31#include "modules/common_msgs/sensor_msgs/pointcloud.pb.h"
32
34
35namespace apollo {
36namespace drivers {
37namespace velodyne {
38
40
42 public:
43 explicit Compensator(const CompensatorConfig& config) : config_(config) {}
44 virtual ~Compensator() {}
45
46 bool MotionCompensation(const std::shared_ptr<const PointCloud>& msg,
47 std::shared_ptr<PointCloud> msg_compensated);
48
49 private:
54 bool QueryPoseAffineFromTF2(const uint64_t& timestamp, void* pose,
55 const std::string& child_frame_id);
56
60 void MotionCompensation(const std::shared_ptr<const PointCloud>& msg,
61 std::shared_ptr<PointCloud> msg_compensated,
62 const uint64_t timestamp_min,
63 const uint64_t timestamp_max,
64 const Eigen::Affine3d& pose_min_time,
65 const Eigen::Affine3d& pose_max_time);
69 inline void GetTimestampInterval(const std::shared_ptr<const PointCloud>& msg,
70 uint64_t* timestamp_min,
71 uint64_t* timestamp_max);
72
73 bool IsValid(const Eigen::Vector3d& point);
74
75 transform::Buffer* tf2_buffer_ptr_ = transform::Buffer::Instance();
76 CompensatorConfig config_;
77};
78
79} // namespace velodyne
80} // namespace drivers
81} // namespace apollo
Compensator(const CompensatorConfig &config)
Definition compensator.h:43
bool MotionCompensation(const std::shared_ptr< const PointCloud > &msg, std::shared_ptr< PointCloud > msg_compensated)
class register implement
Definition arena_queue.h:37