#include <sensor.h>
Inherited by AxisOrientationSensor, RelativePositionSensor, SoundSensor, and SpeedSensor.
Inheritance diagram for Sensor:

Public Types | |
| X = 1 | |
| Y = 2 | |
| Z = 4 | |
| enum | Dimensions { X = 1, Y = 2, Z = 4 } |
| defines which dimensions should be sensed. The meaning is sensor specific. More... | |
Public Member Functions | |
| Sensor () | |
| virtual | ~Sensor () |
| virtual void | init (Primitive *own)=0 |
| initialises sensor with body of robot. | |
| virtual bool | sense (const GlobalData &globaldata)=0 |
| performs sense action | |
| virtual int | getSensorNumber () const =0 |
| returns the number of sensors values produced by this sensor | |
| virtual std::list< sensor > | get () const =0 |
| returns a list of sensor values (usually in the range [0,1] ) | |
| virtual int | get (sensor *sensors, int length) const =0 |
| writes the sensor values (usually in the range [0,1] ) into the giben sensor array and returns the number of sensors written | |
Static Public Member Functions | |
| static std::list< sensor > | selectrows (const matrix::Matrix &m, short dimensions) |
| selects the rows specified by dimensions (X->0, Y->1, Z->2) | |
| static int | selectrows (sensor *sensors, int length, const matrix::Matrix &m, short dimensions) |
| selects the rows specified by dimensions (X->0, Y->1, Z->2) | |
| enum Dimensions |
| Sensor | ( | ) | [inline] |
| virtual ~Sensor | ( | ) | [inline, virtual] |
| virtual int get | ( | sensor * | sensors, | |
| int | length | |||
| ) | const [pure virtual] |
writes the sensor values (usually in the range [0,1] ) into the giben sensor array and returns the number of sensors written
| sensors | call by refernce array which received the values | |
| length | capacity of sensors array |
Implemented in AxisOrientationSensor, RelativePositionSensor, SoundSensor, and SpeedSensor.
| virtual std::list<sensor> get | ( | ) | const [pure virtual] |
returns a list of sensor values (usually in the range [0,1] )
Implemented in AxisOrientationSensor, RelativePositionSensor, SoundSensor, and SpeedSensor.
| virtual int getSensorNumber | ( | ) | const [pure virtual] |
returns the number of sensors values produced by this sensor
Implemented in AxisOrientationSensor, RelativePositionSensor, SoundSensor, and SpeedSensor.
| virtual void init | ( | Primitive * | own | ) | [pure virtual] |
initialises sensor with body of robot.
This is usually done by the robot itself.
Implemented in AxisOrientationSensor, RelativePositionSensor, SoundSensor, and SpeedSensor.
| static int selectrows | ( | sensor * | sensors, | |
| int | length, | |||
| const matrix::Matrix & | m, | |||
| short | dimensions | |||
| ) | [inline, static] |
selects the rows specified by dimensions (X->0, Y->1, Z->2)
| static std::list<sensor> selectrows | ( | const matrix::Matrix & | m, | |
| short | dimensions | |||
| ) | [inline, static] |
selects the rows specified by dimensions (X->0, Y->1, Z->2)
| virtual bool sense | ( | const GlobalData & | globaldata | ) | [pure virtual] |
performs sense action
Implemented in AxisOrientationSensor, RelativePositionSensor, SoundSensor, and SpeedSensor.
1.4.7