Apollo 10.0
自动驾驶开放平台
apollo::drivers::lidar::LidarDriverFactory类 参考

#include <lidar_driver_factory.h>

类 apollo::drivers::lidar::LidarDriverFactory 继承关系图:
apollo::drivers::lidar::LidarDriverFactory 的协作图:

Public 成员函数

 LidarDriverFactory (const apollo::drivers::lidar::config &config)
 
void RegisterLidarClients ()
 Register the lidar driver of all brands.
 
std::unique_ptr< LidarDriverCreateLidarDriver (const std::shared_ptr<::apollo::cyber::Node > &node, const apollo::drivers::lidar::config &parameter)
 Create a pointer to a specified brand of lidar.
 
- Public 成员函数 继承自 apollo::common::util::Factory< LidarParameter::LidarBrand, LidarDriver, LidarDriver *(*)(const std::shared_ptr<::apollo::cyber::Node > &node, const apollo::drivers::lidar::config &config)>
bool Register (const LidarParameter::LidarBrand &id, LidarDriver * creator)
 Registers the class given by the creator function, linking it to id.
 
bool Contains (const LidarParameter::LidarBrand &id)
 
bool Unregister (const LidarParameter::LidarBrand &id)
 Unregisters the class with the given identifier
 
void Clear ()
 
bool Empty () const
 
std::unique_ptr< LidarDriver > CreateObjectOrNull (const LidarParameter::LidarBrand &id, Args &&... args)
 Creates and transfers membership of an object of type matching id.
 
std::unique_ptr< LidarDriver > CreateObject (const LidarParameter::LidarBrand &id, Args &&... args)
 Creates and transfers membership of an object of type matching id.
 

详细描述

在文件 lidar_driver_factory.h45 行定义.

构造及析构函数说明

◆ LidarDriverFactory()

apollo::drivers::lidar::LidarDriverFactory::LidarDriverFactory ( const apollo::drivers::lidar::config config)

在文件 lidar_driver_factory.cc27 行定义.

27{}

成员函数说明

◆ CreateLidarDriver()

std::unique_ptr< LidarDriver > apollo::drivers::lidar::LidarDriverFactory::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.

参数
parameterThe parameter to create the CAN client.
返回
A pointer to the created CAN client.

在文件 lidar_driver_factory.cc50 行定义.

52 {
53 auto factory = CreateObject(parameter.brand(), node, parameter);
54 if (!factory) {
55 AERROR << "Failed to create lidar with parameter: "
56 << parameter.DebugString();
57 }
58 return factory;
59}
std::unique_ptr< LidarDriver > CreateObject(const LidarParameter::LidarBrand &id, Args &&... args)
Creates and transfers membership of an object of type matching id.
Definition factory.h:115
#define AERROR
Definition log.h:44
optional LidarParameter::LidarBrand brand
Definition config.proto:10

◆ RegisterLidarClients()

void apollo::drivers::lidar::LidarDriverFactory::RegisterLidarClients ( )

Register the lidar driver of all brands.

This function call the Function apollo::common::util::Factory::Register() for all of the lidar.

在文件 lidar_driver_factory.cc30 行定义.

30 {
31// Register(LidarParameter::HESAI,
32// [](const std::shared_ptr<::apollo::cyber::Node>& node,
33// const apollo::drivers::lidar::config& config) -> LidarDriver* {
34// return new hesai::HesaiDriver(node, config);
35// });
36 // Register(LidarParameter::ROBOSENSE,
37 // [](const std::shared_ptr<::apollo::cyber::Node>& node,
38 // const apollo::drivers::lidar::config& config) -> LidarDriver*
39 // {
40 // return new robosense::RobosenseDriver(node, config);
41 // });
42 //
44 [](const std::shared_ptr<::apollo::cyber::Node>& node,
45 const apollo::drivers::lidar::config& config) -> LidarDriver* {
47 node, config.velodyne());
48 });
49}
bool Register(const LidarParameter::LidarBrand &id, LidarDriver * creator)
Registers the class given by the creator function, linking it to id.
Definition factory.h:70
static VelodyneDriver * CreateDriver(const std::shared_ptr<::apollo::cyber::Node > &node, const Config &config)
Definition driver.cc:232
optional apollo::drivers::velodyne::Config velodyne
Definition config.proto:12

该类的文档由以下文件生成: