Sound sensor with possible direction and frequency detection and also distance dependence (Not implemented yet) This works, but is not very well tested and documented. More...
#include <soundsensor.h>
Inherits lpzrobots::Sensor.
Public Types | |
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] ) This function should be overloaded. | |
virtual int | get (sensor *sensors, int length) const |
writes the sensor values (usually in the range [0,1] ) into the given sensor array and returns the number of sensors written. |
Sound sensor with possible direction and frequency detection and also distance dependence (Not implemented yet) This works, but is not very well tested and documented.
The angle detection also works without sound and so on. Take a look at the code before using it.
enum Measure |
SoundSensor | ( | Dimensions | dim = Z , |
|
Measure | measure = Angle , |
|||
int | segments = 1 , |
|||
int | levels = 1 , |
|||
float | maxDistance = 1000 | |||
) |
dim | Up-axis of the robot (sometimes it is not Z) |
~SoundSensor | ( | ) | [virtual] |
int get | ( | sensor * | sensors, | |
int | length | |||
) | const [virtual] |
writes the sensor values (usually in the range [0,1] ) into the given sensor array and returns the number of sensors written.
A default implementation based on get() is provided. Only of performance matters overwrite this function.
sensors | call by refernce array which received the values | |
length | capacity of sensors array |
Reimplemented from Sensor.
std::list< sensor > get | ( | ) | const [virtual] |
returns a list of sensor values (usually in the range [0,1] ) This function should be overloaded.
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] |
bool sense | ( | const GlobalData & | globaldata | ) | [virtual] |
performs sense action
Implements Sensor.