Apollo 10.0
自动驾驶开放平台
apollo::audio::AudioComponent类 参考

#include <audio_component.h>

类 apollo::audio::AudioComponent 继承关系图:
apollo::audio::AudioComponent 的协作图:

Public 成员函数

 ~AudioComponent ()
 
std::string Name () const
 
bool Init () override
 
bool Proc (const std::shared_ptr< apollo::drivers::microphone::config::AudioData > &) override
 
- Public 成员函数 继承自 apollo::cyber::Component< apollo::drivers::microphone::config::AudioData >
 Component ()
 
 ~Component () override
 
bool Initialize (const ComponentConfig &config) override
 init the component by protobuf object.
 
bool Process (const std::shared_ptr< apollo::drivers::microphone::config::AudioData > &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< Nodenode_ = nullptr
 
std::string config_file_path_ = ""
 
std::vector< std::shared_ptr< ReaderBase > > readers_
 

详细描述

在文件 audio_component.h37 行定义.

构造及析构函数说明

◆ ~AudioComponent()

apollo::audio::AudioComponent::~AudioComponent ( )

在文件 audio_component.cc29 行定义.

29{}

成员函数说明

◆ Init()

bool apollo::audio::AudioComponent::Init ( )
overridevirtual

实现了 apollo::cyber::ComponentBase.

在文件 audio_component.cc36 行定义.

36 {
37 AudioConf audio_conf;
38 if (!ComponentBase::GetProtoConfig(&audio_conf)) {
39 AERROR << "Unable to load audio conf file: "
40 << ComponentBase::ConfigFilePath();
41 return false;
42 }
43 localization_reader_ =
44 node_->CreateReader<localization::LocalizationEstimate>(
45 audio_conf.topic_conf().localization_topic_name(), nullptr);
46 audio_writer_ = node_->CreateWriter<AudioDetection>(
47 audio_conf.topic_conf().audio_detection_topic_name());
48 respeaker_extrinsics_file_ = audio_conf.respeaker_extrinsics_path();
49 return true;
50}
std::shared_ptr< Node > node_
#define AERROR
Definition log.h:44

◆ Name()

std::string apollo::audio::AudioComponent::Name ( ) const

在文件 audio_component.cc31 行定义.

31 {
32 // TODO(all) implement
33 return "";
34}

◆ Proc()

bool apollo::audio::AudioComponent::Proc ( const std::shared_ptr< apollo::drivers::microphone::config::AudioData > &  )
override

在文件 audio_component.cc52 行定义.

52 {
53 // TODO(all) remove GetSignals() multiple calls
54 AudioDetection audio_detection;
55 MessageProcess::OnMicrophone(*audio_data, respeaker_extrinsics_file_,
56 &audio_info_, &direction_detection_, &moving_detection_,
57 &siren_detection_, &audio_detection);
58
59 FillHeader(node_->Name(), &audio_detection);
60 audio_writer_->Write(audio_detection);
61 return true;
62}
static void OnMicrophone(const apollo::drivers::microphone::config::AudioData &audio_data, const std::string &respeaker_extrinsics_file, AudioInfo *audio_info, DirectionDetection *direction_detection, MovingDetection *moving_detection, SirenDetection *siren_detection, AudioDetection *audio_detection)

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