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

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

- Search for |

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

# RelativePositionSensor Class Reference

Class for relative position sensing. More...

`#include <relativepositionsensor.h>`

Inherits Sensor.

Inheritance diagram for RelativePositionSensor:

[legend]
Collaboration diagram for RelativePositionSensor:

[legend]
List of all members.

## Public Member Functions
| RelativePositionSensor (double maxDistance, double exponent, short dimensions=X|Y|Z)
virtual | ~RelativePositionSensor ()
virtual void | init (Primitive *own)
| initialises sensor with body of robot.
virtual int | getSensorNumber () const
| returns the number of sensors values produced by this sensor
virtual bool | sense (const GlobalData &globaldata)
| performs sense action
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
virtual void | setReference (Primitive *ref)
| Sets the reference object we use for relative position measureing.

## Detailed Description

Class for relative position sensing.

The sensor values are the normalised relative position to some given object ( setReference() )

## Constructor & Destructor Documentation

RelativePositionSensor | ( | double | maxDistance,
|  | double | exponent,
|  | short | dimensions = `X|Y|Z` |
| ) |  |  |

Parameters:

  | maxDistance | maximal distance that is expected used for normalisation of sensor value
  | exponent | exponent of the sensor characteritic (default: 1 (linear))
  | dimensions | bit mask for the dimensions to sense. Default: X | Y | Z (all dimensions)

See also:
  Dimensions

virtual ~RelativePositionSensor | ( |  | ) | `[inline, 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.

void init | ( | Primitive * | own | ) | `[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.

void setReference | ( | Primitive * | ref | ) | `[virtual]`

Sets the reference object we use for relative position measureing.

This can be another robot an obstacle (light source) and such like This must be called before first sense() or get() call.

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

- relativepositionsensor.h
- relativepositionsensor.cpp