IRSensor Class Reference

Class for IR sensors. More...

#include <irsensor.h>

Inherits RaySensor.

Inheritance diagram for IRSensor:

Inheritance graph
[legend]
Collaboration diagram for IRSensor:

Collaboration graph
[legend]
List of all members.

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 in the range [0,1]; 0 means nothing no object in the sensor distance range 1 means contact with another object
virtual void update ()
 updates the position of the osg nodes
virtual void setRange (double range)
 set the range of the sensor
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 An exponential curve is used.

Protected Attributes

dGeomID transform
dGeomID ray
double range
double len
double value
double exponent
OSGCylindersensorBody
OSGBoxsensorRay
OsgHandle osgHandle
bool initialised

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.


Constructor & Destructor Documentation

IRSensor double  exponent = 1  ) 
 

Parameters:
exponent exponent of the sensor characteritic (default: 1 (linear))

~IRSensor  )  [virtual]
 


Member Function Documentation

double characteritic double  len  )  [protected, virtual]
 

describes the sensor characteritic An exponential curve is used.

See also:
setExponent()

double get  )  [virtual]
 

returns the sensor value in the range [0,1]; 0 means nothing no object in the sensor distance range 1 means contact with another object

See also:
characteritic()

Implements RaySensor.

double getExponent  )  const [inline]
 

returns the exponent of the sensor characteritic (default: 1 (linear))

dGeomID getGeomID  )  [virtual]
 

returns the geomID of the ray geom (used for optimisation)

Implements RaySensor.

void init const OdeHandle odeHandle,
const OsgHandle osgHandle,
Primitive body,
const osg::Matrix  pose,
double  range,
rayDrawMode  drawMode = drawSensor
[virtual]
 

providing essential informations

Parameters:
odeHandle OdeHandle
osgHandle OsgHandle
body primitive to which the sensor will be attached
pose relative pose in respect to body in which the sensor will be placed
range length of the sensor
drawMode whether to draw nothing, sensor body, ray, or both

Implements RaySensor.

void reset  )  [virtual]
 

used for reseting the sensor value to a value of maximal distance.

Implements RaySensor.

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.

void setExponent double  exp  )  [inline]
 

sets the exponent of the sensor characteritic (default: 1 (linear))

void setRange double  range  )  [virtual]
 

set the range of the sensor

Parameters:
range new length of the sensor

Implements RaySensor.

void update  )  [virtual]
 

updates the position of the osg nodes

Implements RaySensor.


Member Data Documentation

double exponent [protected]
 

bool initialised [protected]
 

double len [protected]
 

OsgHandle osgHandle [protected]
 

double range [protected]
 

dGeomID ray [protected]
 

OSGCylinder* sensorBody [protected]
 

OSGBox* sensorRay [protected]
 

dGeomID transform [protected]
 

double value [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Jan 16 02:14:56 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8