Gazebo Sim

API Reference

8.7.0
src/systems/logical_audio_sensor_plugin/LogicalAudio.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Open Source Robotics Foundation
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  */
17 #ifndef GZ_SIM_SYSTEMS_LOGICAL_AUDIO_SENSOR_PLUGIN_LOGICALAUDIO_HH_
18 #define GZ_SIM_SYSTEMS_LOGICAL_AUDIO_SENSOR_PLUGIN_LOGICALAUDIO_HH_
19 
20 #include <string>
21 
23 #include <gz/sim/config.hh>
24 #include <gz/sim/logicalaudiosensorplugin-system/Export.hh>
25 #include <gz/math/Pose3.hh>
26 
27 namespace gz
28 {
29 namespace sim
30 {
31 // Inline bracket to help doxygen filtering.
32 inline namespace GZ_SIM_VERSION_NAMESPACE {
33 namespace logical_audio
34 {
45  GZ_SIM_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
46  bool detect(double _volumeLevel, double _volumeDetectionThreshold);
47 
66  GZ_SIM_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
67  double computeVolume(bool _playing,
68  AttenuationFunction _attenuationFunc,
69  AttenuationShape _attenuationShape,
70  double _sourceEmissionVolume,
71  double _innerRadius,
72  double _falloffDistance,
73  const gz::math::Pose3d &_sourcePose,
74  const gz::math::Pose3d &_targetPose);
75 
89  GZ_SIM_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
91  std::string _str);
92 
105  GZ_SIM_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
106  void setAttenuationShape(AttenuationShape &_attenuationShape,
107  std::string _str);
108 
118  GZ_SIM_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
119  void validateInnerRadiusAndFalloffDistance(double &_innerRadius,
120  double &_falloffDistance);
121 
126  GZ_SIM_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
127  void validateVolumeLevel(double &_volumeLevel);
128 }
129 }
130 }
131 }
132 
133 #endif