Apollo  6.0
Open source self driving car software
fusion_component.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2018 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 
28 #include "modules/perception/onboard/proto/fusion_component_config.pb.h"
29 
30 namespace apollo {
31 namespace perception {
32 namespace onboard {
33 
34 class FusionComponent : public cyber::Component<SensorFrameMessage> {
35  public:
36  FusionComponent() = default;
37  ~FusionComponent() = default;
38  bool Init() override;
39  bool Proc(const std::shared_ptr<SensorFrameMessage>& message) override;
40 
41  private:
42  bool InitAlgorithmPlugin();
43  bool InternalProc(const std::shared_ptr<SensorFrameMessage const>& in_message,
44  std::shared_ptr<PerceptionObstacles> out_message,
45  std::shared_ptr<SensorFrameMessage> viz_message);
46 
47  private:
48  static std::mutex s_mutex_;
49  static uint32_t s_seq_num_;
50 
51  std::string fusion_name_;
52  std::string fusion_method_;
53  std::vector<std::string> fusion_main_sensors_;
54  bool object_in_roi_check_ = false;
55  double radius_for_roi_object_check_ = 0;
56 
57  std::unique_ptr<fusion::BaseMultiSensorFusion> fusion_;
58  map::HDMapInput* hdmap_input_ = nullptr;
59  std::shared_ptr<apollo::cyber::Writer<PerceptionObstacles>> writer_;
60  std::shared_ptr<apollo::cyber::Writer<SensorFrameMessage>> inner_writer_;
61 };
62 
64 
65 } // namespace onboard
66 } // namespace perception
67 } // namespace apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: hdmap_input.h:34
bool Proc(const std::shared_ptr< SensorFrameMessage > &message) override
The Component can process up to four channels of messages. The message type is specified when the com...
Definition: component.h:58
CYBER_REGISTER_COMPONENT(CameraObstacleDetectionComponent)
Definition: fusion_component.h:34