Gazebo Gazebo

API Reference

6.16.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_GAZEBO_SYSTEMS_LOGICAL_AUDIO_SENSOR_PLUGIN_LOGICALAUDIO_HH_
18 #define GZ_GAZEBO_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 ignition
28 {
29 namespace gazebo
30 {
31 // Inline bracket to help doxygen filtering.
32 inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
33 namespace logical_audio
34 {
45  IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
46  bool detect(double _volumeLevel, double _volumeDetectionThreshold);
47 
66  IGNITION_GAZEBO_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  IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
90  void setAttenuationFunction(AttenuationFunction &_attenuationFunc,
91  std::string _str);
92 
105  IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
106  void setAttenuationShape(AttenuationShape &_attenuationShape,
107  std::string _str);
108 
118  IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
119  void validateInnerRadiusAndFalloffDistance(double &_innerRadius,
120  double &_falloffDistance);
121 
126  IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE
127  void validateVolumeLevel(double &_volumeLevel);
128 }
129 }
130 }
131 }
132 
133 #endif
IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE void setAttenuationFunction(AttenuationFunction &_attenuationFunc, std::string _str)
Set the attenuation function that matches the defined string. The string is not case sensitive,...
This library is part of the Gazebo project.
STL class.
IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE void setAttenuationShape(AttenuationShape &_attenuationShape, std::string _str)
Set the attenuation shape that matches the defined string. The string is not case sensitive,...
IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE void validateVolumeLevel(double &_volumeLevel)
Validate a source's emission volume level.
AttenuationShape
Audio source attenuation shapes. AttenuationShape::Undefined is used to indicate that an attenuation ...
Definition: include/gz/sim/components/LogicalAudio.hh:46
AttenuationFunction
Audio source attenuation functions. AttenuationFunction::Undefined is used to indicate that an attenu...
Definition: include/gz/sim/components/LogicalAudio.hh:41
IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE void validateInnerRadiusAndFalloffDistance(double &_innerRadius, double &_falloffDistance)
Validate the inner radius and falloff distance for an audio source.
IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE bool detect(double _volumeLevel, double _volumeDetectionThreshold)
Determines if an audio device can detect volume at a certain level.
IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE double computeVolume(bool _playing, AttenuationFunction _attenuationFunc, AttenuationShape _attenuationShape, double _sourceEmissionVolume, double _innerRadius, double _falloffDistance, const gz::math::Pose3d &_sourcePose, const gz::math::Pose3d &_targetPose)
Computes the volume level of an audio source at a certain location.