Apollo 11.0
自动驾驶开放平台
third_party_perception_smartereye.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
18#include <memory>
19
24
25namespace apollo {
26namespace third_party_perception {
27
29
31 apollo::cyber::Node* const node) :ThirdPartyPerception(node) {
32 smartereye_obstacles_reader_ =
34 FLAGS_smartereye_obstacles_topic,
35 [this](const std::shared_ptr<
37 OnSmartereye(*message.get());
38 });
39 smartereye_lanemark_reader_ =
41 FLAGS_smartereye_lanemark_topic,
42 [this](const std::shared_ptr<
44 OnSmartereyeLanemark(*message.get());
45 });
46}
47
50 ADEBUG << "Received smartereye data: run smartereye callback.";
51 std::lock_guard<std::mutex> lock(third_party_perception_mutex_);
53 message, smartereye_lanemark_, localization_, chassis_);
54}
55
58 ADEBUG << "Received smartereye data: run smartereye callback.";
59 std::lock_guard<std::mutex> lock(third_party_perception_mutex_);
60 smartereye_lanemark_.CopyFrom(message);
61}
62
64 PerceptionObstacles* const response) {
65 ADEBUG << "Timer is triggered: publish PerceptionObstacles";
66 CHECK_NOTNULL(response);
67
68 std::lock_guard<std::mutex> lock(third_party_perception_mutex_);
69
70 *response = eye_obstacles_;
71
72 common::util::FillHeader(FLAGS_third_party_perception_node_name, response);
73
74 eye_obstacles_.Clear();
75 return true;
76}
77
78} // namespace third_party_perception
79} // namespace apollo
Node is the fundamental building block of Cyber RT.
Definition node.h:44
bool Process(apollo::perception::PerceptionObstacles *const response) override
void OnSmartereye(const apollo::drivers::SmartereyeObstacles &message)
apollo::localization::LocalizationEstimate localization_
#define ADEBUG
Definition log.h:41
Some string util functions.
apollo::perception::PerceptionObstacles SmartereyeToPerceptionObstacles(const apollo::drivers::SmartereyeObstacles &smartereye_obstacles, const apollo::drivers::SmartereyeLanemark &smartereye_lanemark, const apollo::localization::LocalizationEstimate &localization, const apollo::canbus::Chassis &chassis)
class register implement
Definition arena_queue.h:37