Apollo 10.0
自动驾驶开放平台
audio_component.h
浏览该文件的文档.
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/common_msgs/localization_msgs/localization.pb.h"
29
34namespace apollo {
35namespace 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
bool Proc(const std::shared_ptr< apollo::drivers::microphone::config::AudioData > &) override
#define CYBER_REGISTER_COMPONENT(name)
Definition component.h:656
class register implement
Definition arena_queue.h:37