Apollo  6.0
Open source self driving car software
audio_component.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 
21 #pragma once
22 
23 #include <memory>
24 #include <string>
25 
28 #include "modules/localization/proto/localization.pb.h"
29 
34 namespace apollo {
35 namespace audio {
36 
38  : public cyber::Component<apollo::drivers::microphone::config::AudioData> {
39  public:
41 
42  std::string Name() const;
43 
44  bool Init() override;
45 
46  bool Proc(
47  const std::shared_ptr<apollo::drivers::microphone::config::AudioData>&)
48  override;
49 
50  private:
51  std::shared_ptr<cyber::Reader<localization::LocalizationEstimate>>
52  localization_reader_;
53 
54  std::shared_ptr<cyber::Writer<AudioDetection>> audio_writer_;
55 
56  AudioInfo audio_info_;
57 
58  DirectionDetection direction_detection_;
59  MovingDetection moving_detection_;
60  SirenDetection siren_detection_;
61  std::string respeaker_extrinsics_file_;
62 };
63 
65 
66 } // namespace audio
67 } // namespace apollo
Definition: audio_component.h:37
Definition: moving_detection.h:31
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
std::string Name() const
Definition: audio_info.h:28
Definition: direction_detection.h:45
#define CYBER_REGISTER_COMPONENT(name)
Definition: component.h:551
bool Proc(const std::shared_ptr< apollo::drivers::microphone::config::AudioData > &) override
Definition: siren_detection.h:32
The Component can process up to four channels of messages. The message type is specified when the com...
Definition: component.h:58