Apollo 10.0
自动驾驶开放平台
lidar_driver_component.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 "modules/drivers/lidar/proto/lidar_parameter.pb.h"
19
20namespace apollo {
21namespace drivers {
22namespace lidar {
23
26 if (!GetProtoConfig(&conf_)) {
27 AERROR << "load config error, file:" << config_file_path_;
28 return false;
29 }
30 node_ = apollo::cyber::CreateNode("drivers_lidar");
31 AINFO << "conf:" << conf_.DebugString();
32 LidarDriverFactory::Instance()->RegisterLidarClients();
33 driver_ = LidarDriverFactory::Instance()->CreateLidarDriver(node_, conf_);
34 if (driver_ == nullptr || !driver_->Init()) {
35 AERROR << "driver init error";
36 return false;
37 }
38 return true;
39}
40
41} // namespace lidar
42} // namespace drivers
43} // namespace apollo
bool GetProtoConfig(T *config) const
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42
std::unique_ptr< Node > CreateNode(const std::string &node_name, const std::string &name_space)
Definition cyber.cc:33
class register implement
Definition arena_queue.h:37