Apollo 11.0
自动驾驶开放平台
pointcloud_preprocess_component.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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 <atomic>
20#include <limits>
21#include <memory>
22#include <string>
23
24#include "modules/common_msgs/sensor_msgs/pointcloud.pb.h"
25#include "modules/perception/pointcloud_preprocess/proto/pointcloud_preprocess_component_config.pb.h"
26
31
32namespace apollo {
33namespace perception {
34namespace lidar {
35
37 : public cyber::Component<drivers::PointCloud> {
38 public:
40 virtual ~PointCloudPreprocessComponent() = default;
47 bool Init() override;
55 bool Proc(const std::shared_ptr<drivers::PointCloud>& message) override;
56
57 private:
58 bool InitAlgorithmPlugin();
59 bool InternalProc(
60 const std::shared_ptr<const drivers::PointCloud>& in_message,
61 const std::shared_ptr<onboard::LidarFrameMessage>& out_message);
62
63 private:
64 static std::atomic<uint32_t> seq_num_;
65 std::string sensor_name_;
66 std::string config_path_;
67 std::string config_file_;
68 float lidar_query_tf_offset_ = 20.0f;
69 std::string lidar2novatel_tf2_child_frame_id_;
70 std::string output_channel_name_;
71 std::string pointcloud_preprocess_config_file_;
72 onboard::TransformWrapper lidar2world_trans_;
73 base::SensorInfo sensor_info_;
74
75 std::shared_ptr<apollo::cyber::Writer<onboard::LidarFrameMessage>> writer_;
76
77 // preprocessor
78 BasePointCloudPreprocessor* cloud_preprocessor_;
79};
80
82
83} // namespace lidar
84} // namespace perception
85} // namespace apollo
bool Proc(const std::shared_ptr< drivers::PointCloud > &message) override
Process of pointcloud preprocess
bool Init() override
Init pointcloud preprocess component
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:657
class register implement
Definition arena_queue.h:37