Apollo 11.0
自动驾驶开放平台
multi_sensor_fusion_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#pragma once
17
18#include <memory>
19#include <string>
20#include <vector>
21
22#include "modules/perception/multi_sensor_fusion/proto/fusion_component_config.pb.h"
23
29
30namespace apollo {
31namespace perception {
32namespace fusion {
33
34using onboard::SensorFrameMessage;
35
36class MultiSensorFusionComponent : public cyber::Component<SensorFrameMessage> {
37 public:
40 bool Init() override;
41 bool Proc(const std::shared_ptr<SensorFrameMessage>& message) override;
42
43 private:
44 bool InitAlgorithmPlugin(const FusionComponentConfig &config);
45 bool InternalProc(const std::shared_ptr<SensorFrameMessage const>& in_message,
46 std::shared_ptr<PerceptionObstacles> out_message,
47 std::shared_ptr<SensorFrameMessage> viz_message);
48
49 private:
50 static std::mutex s_mutex_;
51 static uint32_t s_seq_num_;
52
53 bool object_in_roi_check_ = false;
54 double radius_for_roi_object_check_ = 0;
55
56 std::unique_ptr<fusion::BaseFusionSystem> fusion_;
57 map::HDMapInput* hdmap_input_ = nullptr;
58 std::shared_ptr<apollo::cyber::Writer<PerceptionObstacles>> writer_;
59 std::shared_ptr<apollo::cyber::Writer<SensorFrameMessage>> inner_writer_;
60};
61
63
64} // namespace fusion
65} // namespace perception
66} // namespace apollo
bool Proc(const std::shared_ptr< SensorFrameMessage > &message) override
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:657
class register implement
Definition arena_queue.h:37