Robot Simulator of the Robotics Group for Self-Organization of Control: Sensor Class Reference

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

- Search for |

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

# Sensor Class Reference

Abstract class for sensors that have no specific position at the robots skeleton. More...

`#include <sensor.h>`

Inherited by AxisOrientationSensor, RelativePositionSensor, SoundSensor, and SpeedSensor.

Inheritance diagram for Sensor:

[legend]
List of all members.

## 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)

## Detailed Description

Abstract class for sensors that have no specific position at the robots skeleton.

## Member Enumeration Documentation

enum Dimensions

defines which dimensions should be sensed. The meaning is sensor specific.

Enumerator:

  X |
  Y |
  Z |

## Constructor & Destructor Documentation

Sensor | ( |  | ) | `[inline]`

virtual ~Sensor | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

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

Parameters:

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

Returns:
  number of sensor values written

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.

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

- sensor.h