Robotsystem from Robot Group Leipzig: IRSensor Class Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

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

# IRSensor Class Reference

`#include <irsensor.h>`

Inheritance diagram for IRSensor:

[legend]
Collaboration diagram for IRSensor:

[legend]
List of all members.

## Detailed Description

Class for IR sensors.

IR sensors are based on distance measurements using the ODE geom class Ray. The sensor value is obtained by collisions. However of no collision is detected the sensor needs to ajust its output as well. Therefore a reset function is provided.

Definition at line 69 of file irsensor.h.

## Public Member Functions
| IRSensor (double exponent=1)
virtual | ~IRSensor ()
virtual void | init (const OdeHandle &odeHandle, const OsgHandle &osgHandle, Primitive *body, const osg::Matrix pose, double range, rayDrawMode drawMode=drawSensor)
| providing essential informations
virtual void | reset ()
| used for reseting the sensor value to a value of maximal distance.
virtual bool | sense (dGeomID object)
| performs sense action by checking collision with the given object
virtual double | get ()
| returns the sensor value (usually in the range [-1,1] )
virtual void | update ()
| draws the sensor ray
virtual dGeomID | getGeomID ()
| returns the geomID of the ray geom (used for optimisation)
double | getExponent () const
| returns the exponent of the sensor characteritic (default: 1 (linear))
void | setExponent (double exp)
| sets the exponent of the sensor characteritic (default: 1 (linear))
## Protected Member Functions
virtual double | characteritic (double len)
| describes the sensor characteritic linear curve used here
## Protected Attributes
dGeomID | transform
dGeomID | ray
double | range
double | len
double | value
double | exponent
OSGCylinder * | sensorBody
OSGBox * | sensorRay
OsgHandle | osgHandle
bool | initialised

## Constructor & Destructor Documentation

IRSensor | ( | double | exponent = `1` | ) |

  | Parameters:
  | exponent | exponent of the sensor characteritic (default: 1 (linear))
Definition at line 66 of file irsensor.cpp.

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

| Definition at line 76 of file irsensor.cpp.

## Member Function Documentation

double characteritic | ( | double | len | ) | `[protected, virtual]`

| describes the sensor characteritic linear curve used here Definition at line 187 of file irsensor.cpp.

double get | ( |  | ) | `[virtual]`

| returns the sensor value (usually in the range [-1,1] ) Implements RaySensor. Definition at line 149 of file irsensor.cpp.

double getExponent | ( |  | ) | const`[inline]`

| returns the exponent of the sensor characteritic (default: 1 (linear)) Definition at line 108 of file irsensor.h.

dGeomID getGeomID | ( |  | ) | `[virtual]`

| returns the geomID of the ray geom (used for optimisation) Implements RaySensor. Definition at line 183 of file irsensor.cpp.

void init | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle,
|  | Primitive * | body,
|  | const osg::Matrix | pose,
|  | double | range,
|  | rayDrawMode | drawMode = `drawSensor`
| ) | `[virtual]`

| providing essential informations Definition at line 80 of file irsensor.cpp.

void reset | ( |  | ) | `[virtual]`

| used for reseting the sensor value to a value of maximal distance. Implements RaySensor. Definition at line 124 of file irsensor.cpp.

bool sense | ( | dGeomID | object | ) | `[virtual]`

| performs sense action by checking collision with the given object Returns: true for collision handled (sensed) and false for no interaction Implements RaySensor. Definition at line 129 of file irsensor.cpp.

void setExponent | ( | double | exp | ) | `[inline]`

| sets the exponent of the sensor characteritic (default: 1 (linear)) Definition at line 111 of file irsensor.h.

void update | ( |  | ) | `[virtual]`

| draws the sensor ray Implements RaySensor. Definition at line 153 of file irsensor.cpp.

## Member Data Documentation

double exponent`[protected]`

| Definition at line 125 of file irsensor.h.

bool initialised`[protected]`

| Definition at line 131 of file irsensor.h.

double len`[protected]`

| Definition at line 123 of file irsensor.h.

OsgHandle osgHandle`[protected]`

| Definition at line 129 of file irsensor.h.

double range`[protected]`

| Definition at line 122 of file irsensor.h.

dGeomID ray`[protected]`

| Definition at line 121 of file irsensor.h.

OSGCylinder* sensorBody`[protected]`

| Definition at line 127 of file irsensor.h.

OSGBox* sensorRay`[protected]`

| Definition at line 128 of file irsensor.h.

dGeomID transform`[protected]`

| Definition at line 120 of file irsensor.h.

double value`[protected]`

| Definition at line 124 of file irsensor.h.