Robotsystem of the Robot Group Leipzig: SoundSensor Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# SoundSensor Class Reference

Sound sensor with possible direction and frequency detection and also distance dependence. More...

`#include <soundsensor.h>`

Inherits Sensor.

Inheritance diagram for SoundSensor:

[legend]
Collaboration diagram for SoundSensor:

[legend]
List of all members.

## Public Types
| Segments
| Angle
| AngleVel
enum | Measure { Segments, Angle, AngleVel }
## Public Member Functions
| SoundSensor (Dimensions dim=Z, Measure measure=Angle, int segments=1, int levels=1, float maxDistance=1000)
virtual | ~SoundSensor ()
virtual void | init (Primitive *own)
| initialises sensor with body of robot.
virtual bool | sense (const GlobalData &globaldata)
| performs sense action
virtual int | getSensorNumber () const
| returns the number of sensors values produced by this sensor
virtual std::list< sensor > | get () const
| returns a list of sensor values (usually in the range [0,1] )
virtual int | get (sensor *sensors, int length) const
| writes the sensor values (usually in the range [0,1] ) into the giben sensor array and returns the number of sensors written

## Detailed Description

Sound sensor with possible direction and frequency detection and also distance dependence.

## Member Enumeration Documentation

enum Measure

Enumerator:

  Segments |
  Angle |
  AngleVel |

## Constructor & Destructor Documentation

SoundSensor | ( | Dimensions | dim = `Z`,
|  | Measure | measure = `Angle`,
|  | int | segments = `1`,
|  | int | levels = `1`,
|  | float | maxDistance = `1000` |
| ) |  |  |

Parameters:

  | dim | Up-axis of the robot (sometimes it is not Z)

~SoundSensor | ( |  | ) | `[virtual]`

## Member Function Documentation

int get | ( | sensor * | sensors,
|  | int | length |
| ) |  |  | const`[virtual]`

writes the sensor values (usually in the range [0,1] ) into the giben sensor array and returns the number of sensors written

Parameters:

  | sensors | call by refernce array which received the values
  | length | capacity of sensors array

Returns:
  number of sensor values written

Implements Sensor.

std::list< sensor > get | ( |  | ) | const`[virtual]`

returns a list of sensor values (usually in the range [0,1] )

Implements Sensor.

int getSensorNumber | ( |  | ) | const`[virtual]`

returns the number of sensors values produced by this sensor

Implements Sensor.

virtual void init | ( | Primitive * | own | ) | `[inline, virtual]`

initialises sensor with body of robot.

This is usually done by the robot itself.

Implements Sensor.

bool sense | ( | const GlobalData & | globaldata | ) | `[virtual]`

performs sense action

Implements Sensor.

The documentation for this class was generated from the following files:

- soundsensor.h
- soundsensor.cpp