Apollo 11.0
自动驾驶开放平台
apollo::perception::radar::RadarDetectionComponent类 参考

#include <radar_detection_component.h>

类 apollo::perception::radar::RadarDetectionComponent 继承关系图:
apollo::perception::radar::RadarDetectionComponent 的协作图:

Public 成员函数

 RadarDetectionComponent ()
 
 ~RadarDetectionComponent ()=default
 
bool Init () override
 
bool Proc (const std::shared_ptr< ContiRadar > &message) override
 
- Public 成员函数 继承自 apollo::cyber::Component< ContiRadar >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< ContiRadar > &msg0, const std::shared_ptr< NullType > &msg1, const std::shared_ptr< NullType > &msg2, const std::shared_ptr< NullType > &msg3)
 
- Public 成员函数 继承自 apollo::cyber::ComponentBase
virtual ~ComponentBase ()
 
virtual bool Initialize (const TimerComponentConfig &config)
 
virtual void Shutdown ()
 
template<typename T >
bool GetProtoConfig (T *config) const
 

额外继承的成员函数

- Public 类型 继承自 apollo::cyber::ComponentBase
template<typename M >
using Reader = cyber::Reader< M >
 
- Protected 成员函数 继承自 apollo::cyber::ComponentBase
virtual void Clear ()
 
const std::string & ConfigFilePath () const
 
void LoadConfigFiles (const ComponentConfig &config)
 
void LoadConfigFiles (const TimerComponentConfig &config)
 
- Protected 属性 继承自 apollo::cyber::ComponentBase
std::atomic< bool > is_shutdown_ = {false}
 
std::shared_ptr< Node > node_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

在文件 radar_detection_component.h 第 42 行定义.

构造及析构函数说明

◆ RadarDetectionComponent()

apollo::perception::radar::RadarDetectionComponent::RadarDetectionComponent ( )
inline

在文件 radar_detection_component.h 第 44 行定义.

45 : seq_num_(0),
46 tf_child_frame_id_(""),
47 radar_forward_distance_(200.0),
48 odometry_channel_name_(""),
49 hdmap_input_(nullptr),
50 radar_preprocessor_(nullptr),
51 radar_perception_(nullptr) {}

◆ ~RadarDetectionComponent()

apollo::perception::radar::RadarDetectionComponent::~RadarDetectionComponent ( )
default

成员函数说明

◆ Init()

bool apollo::perception::radar::RadarDetectionComponent::Init ( )
overridevirtual

实现了 apollo::cyber::ComponentBase.

在文件 radar_detection_component.cc 第 29 行定义.

29 {
30 RadarComponentConfig comp_config;
31 if (!GetProtoConfig(&comp_config)) {
32 return false;
33 }
34 AINFO << "Radar component config: " << comp_config.DebugString();
35
36 // To load component configs
37 tf_child_frame_id_ = comp_config.tf_child_frame_id();
38 radar_forward_distance_ = comp_config.radar_forward_distance();
39 odometry_channel_name_ = comp_config.odometry_channel_name();
40
41 if (!algorithm::SensorManager::Instance()->GetSensorInfo(
42 comp_config.radar_name(), &radar_info_)) {
43 AERROR << "Failed to get sensor info, sensor name: "
44 << comp_config.radar_name();
45 return false;
46 }
47
48 writer_ = node_->CreateWriter<onboard::SensorFrameMessage>(
49 comp_config.output_channel_name());
50
51 // Init algorithm plugin
52 ACHECK(InitAlgorithmPlugin(comp_config))
53 << "Failed to init algorithm plugin.";
54
55 radar2world_trans_.Init(tf_child_frame_id_);
56 radar2novatel_trans_.Init(tf_child_frame_id_);
57 localization_subscriber_.Init(
58 odometry_channel_name_,
59 odometry_channel_name_ + '_' + comp_config.radar_name());
60 return true;
61}
bool GetProtoConfig(T *config) const
std::shared_ptr< Node > node_
void Init(const std::string &sensor2novatel_tf2_child_frame_id)
#define ACHECK(cond)
Definition log.h:80
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42

◆ Proc()

bool apollo::perception::radar::RadarDetectionComponent::Proc ( const std::shared_ptr< ContiRadar > &  message)
override

在文件 radar_detection_component.cc 第 63 行定义.

63 {
64 AINFO << "Enter radar preprocess, message timestamp: "
65 << message->header().timestamp_sec() << " current timestamp "
67 auto out_message = std::make_shared<onboard::SensorFrameMessage>();
68
69 if (!InternalProc(message, out_message)) {
70 return false;
71 }
72 writer_->Write(out_message);
73 return true;
74}
static double NowInSeconds()
gets the current time in second.
Definition clock.cc:56

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