Apollo 11.0
自动驾驶开放平台
third_party_perception_mobileye.cc
浏览该文件的文档.
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 *****************************************************************************/
17
25
26namespace apollo {
27namespace third_party_perception {
28
33
35 apollo::cyber::Node* const node)
36 : ThirdPartyPerception(node) {
37 mobileye_reader_ = node_->CreateReader<apollo::drivers::Mobileye>(
38 FLAGS_mobileye_topic,
39 [this](const std::shared_ptr<apollo::drivers::Mobileye>& message) {
40 OnMobileye(*message.get());
41 });
42 delphi_esr_reader_ = node_->CreateReader<apollo::drivers::DelphiESR>(
43 FLAGS_delphi_esr_topic,
44 [this](const std::shared_ptr<apollo::drivers::DelphiESR>& message) {
45 OnDelphiESR(*message.get());
46 });
47
48 conti_radar_reader_ = node_->CreateReader<apollo::drivers::ContiRadar>(
49 FLAGS_conti_radar_topic,
50 [this](const std::shared_ptr<apollo::drivers::ContiRadar>& message) {
51 OnContiRadar(*message.get());
52 });
53}
54
56 ADEBUG << "Received mobileye data: run mobileye callback.";
57 std::lock_guard<std::mutex> lock(third_party_perception_mutex_);
59 message, localization_, chassis_);
60}
61
63 ADEBUG << "Received delphi esr data: run delphi esr callback.";
64 std::lock_guard<std::mutex> lock(third_party_perception_mutex_);
68 RadarObstacles filtered_radar_obstacles =
70 if (FLAGS_enable_radar) {
72 filtered_radar_obstacles);
73 }
74}
75
77 ADEBUG << "Received delphi esr data: run continental radar callback.";
78 std::lock_guard<std::mutex> lock(third_party_perception_mutex_);
82 RadarObstacles filtered_radar_obstacles =
84 if (FLAGS_enable_radar) {
86 filtered_radar_obstacles);
87 }
88}
89
91 PerceptionObstacles* const response) {
92 ADEBUG << "Timer is triggered: publish PerceptionObstacles";
93 CHECK_NOTNULL(response);
94
95 std::lock_guard<std::mutex> lock(third_party_perception_mutex_);
96
97 *response = fusion::EyeRadarFusion(eye_obstacles_, radar_obstacles_);
98
99 common::util::FillHeader(FLAGS_third_party_perception_node_name, response);
100
101 eye_obstacles_.Clear();
102 radar_obstacles_.Clear();
103 return true;
104}
105
106} // namespace third_party_perception
107} // namespace apollo
Node is the fundamental building block of Cyber RT.
Definition node.h:44
bool Process(apollo::perception::PerceptionObstacles *const response) override
apollo::localization::LocalizationEstimate localization_
#define ADEBUG
Definition log.h:41
Some string util functions.
PerceptionObstacles MobileyeToPerceptionObstacles(const Mobileye &mobileye, const LocalizationEstimate &localization, const Chassis &chassis)
PerceptionObstacles RadarObstaclesToPerceptionObstacles(const RadarObstacles &radar_obstacles)
RadarObstacles ContiToRadarObstacles(const apollo::drivers::ContiRadar &conti_radar, const apollo::localization::LocalizationEstimate &localization, const RadarObstacles &last_radar_obstacles, const Chassis &chassis)
RadarObstacles DelphiToRadarObstacles(const DelphiESR &delphi_esr, const LocalizationEstimate &localization, const RadarObstacles &last_radar_obstacles)
RadarObstacles FilterRadarObstacles(const RadarObstacles &radar_obstacles)
Definition filter.cc:49
PerceptionObstacles EyeRadarFusion(const PerceptionObstacles &eye_obstacles, const PerceptionObstacles &radar_obstacles)
Definition fusion.cc:67
class register implement
Definition arena_queue.h:37