Apollo  6.0
Open source self driving car software
v2x_fusion_component.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright 2020 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 
21 #include <cmath>
22 #include <condition_variable>
23 #include <limits>
24 #include <memory>
25 #include <string>
26 #include <thread>
27 #include <vector>
28 
35 
36 namespace apollo {
37 namespace v2x {
38 namespace ft {
39 
41  : public apollo::cyber::Component<PerceptionObstacles> {
42  public:
44 
45  std::string Name() const;
46 
47  bool Init() override;
48 
49  bool Proc(const std::shared_ptr<PerceptionObstacles>& perception_obstacles)
50  override;
51 
52  private:
53  bool V2XMessageFusionProcess(
54  const std::shared_ptr<PerceptionObstacles>& perception_obstacles);
55  void SerializeMsg(const std::vector<base::Object>& objects,
56  std::shared_ptr<PerceptionObstacles> obstacles);
57  Fusion fusion_;
58 
59  std::shared_ptr<apollo::cyber::Reader<LocalizationEstimate>>
60  localization_reader_;
61  std::shared_ptr<apollo::cyber::Reader<V2XObstacles>> v2x_obstacles_reader_;
62  std::shared_ptr<apollo::cyber::Writer<PerceptionObstacles>>
63  perception_fusion_obstacles_writer_;
64  apollo::common::Header header_;
65 };
66 
68 
69 } // namespace ft
70 } // namespace v2x
71 } // namespace apollo
Definition: fusion.h:38
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: v2x_fusion_component.h:40
bool Proc(const std::shared_ptr< PerceptionObstacles > &perception_obstacles) override
#define CYBER_REGISTER_COMPONENT(name)
Definition: component.h:551
The Component can process up to four channels of messages. The message type is specified when the com...
Definition: component.h:58