Apollo  6.0
Open source self driving car software
lidar_driver_factory.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 
22 #pragma once
23 
24 #include <memory>
25 #include <unordered_map>
26 
27 #include "modules/drivers/lidar/proto/config.pb.h"
28 #include "modules/drivers/lidar/proto/lidar_parameter.pb.h"
29 
30 #include "cyber/common/macros.h"
31 #include "cyber/cyber.h"
35 
41 namespace apollo {
42 namespace drivers {
43 namespace lidar {
44 
47  LidarParameter::LidarBrand, LidarDriver,
48  LidarDriver* (*)(const std::shared_ptr<::apollo::cyber::Node>& node,
49  const apollo::drivers::lidar::config& config)> {
50  public:
51  LidarDriverFactory(const apollo::drivers::lidar::config& config);
57  void RegisterLidarClients();
58 
65  std::unique_ptr<LidarDriver> CreateLidarDriver(
66  const std::shared_ptr<::apollo::cyber::Node>& node,
67  const apollo::drivers::lidar::config& parameter);
68 
69  protected:
70  private:
72 };
73 
74 } // namespace lidar
75 } // namespace drivers
76 } // namespace apollo
LidarDriverFactory(const apollo::drivers::lidar::config &config)
std::unique_ptr< LidarDriver > CreateLidarDriver(const std::shared_ptr<::apollo::cyber::Node > &node, const apollo::drivers::lidar::config &parameter)
Create a pointer to a specified brand of lidar. The brand is set in the parameter.
Definition: lidar_driver_factory.h:45
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Implements a Factory design pattern with Register and Create methods.
Definition: factory.h:60
Defines the CanFrame struct and CanClient interface.
#define DECLARE_SINGLETON(classname)
Definition: macros.h:52
Defines the Factory class.
void RegisterLidarClients()
Register the lidar driver of all brands. This function call the Function apollo::common::util::Factor...