RaySensorBank Class Reference

Class for a bank (collection) of ray sensors. More...

#include <raysensorbank.h>

Collaboration diagram for RaySensorBank:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RaySensorBank ()
virtual ~RaySensorBank ()
virtual void init (const OdeHandle &odeHandle, const OsgHandle &osgHandle)
 initialises sensor bank with handles for ode and osg
virtual unsigned int registerSensor (RaySensor *raysensor, Primitive *body, const osg::Matrix &pose, double range, RaySensor::rayDrawMode drawMode)
 registers a new sensor at the sensor bank.
virtual void reset ()
 resets all sensors (used for reseting the sensor value to a value of maximal distance)
virtual bool sense (dGeomID object)
 performs sense action of all sensors by checking collision with the given object
virtual double get (unsigned int index)
 returns the sensor value of the given sensor (usually in the range [-1,1] )
virtual int get (double *sensorarray, unsigned int array_size)
 writes sensorvalues in given sensorarray
virtual void setRange (unsigned int index, double range)
 set the range of the specified sensor (index)
virtual void setRange (double range)
 set the range of all sensors
virtual dSpaceID getSpaceID ()
 returns the spaceID of the sensor space
virtual void update ()
 updates the sensor's graphical representation
virtual void clear ()

Protected Attributes

std::vector< RaySensor * > bank
bool initialized
OdeHandle odeHandle
OsgHandle osgHandle

Detailed Description

Class for a bank (collection) of ray sensors.

Ray sensors can be registered at the bank. Methods for resetting, sensing and reading the sensor values of all sensors are provided.


Constructor & Destructor Documentation

RaySensorBank  ) 
 

~RaySensorBank  )  [virtual]
 


Member Function Documentation

void clear  )  [virtual]
 

int get double *  sensorarray,
unsigned int  array_size
[virtual]
 

writes sensorvalues in given sensorarray

Parameters:
sensorarray pointer to the sensorarray in which the values should be stored
array_size maximal number of all elements in the sensorarray
Returns:
number of written sensorvalues

double get unsigned int  index  )  [virtual]
 

returns the sensor value of the given sensor (usually in the range [-1,1] )

dSpaceID getSpaceID  )  [virtual]
 

returns the spaceID of the sensor space

void init const OdeHandle odeHandle,
const OsgHandle osgHandle
[virtual]
 

initialises sensor bank with handles for ode and osg

unsigned int registerSensor RaySensor raysensor,
Primitive body,
const osg::Matrix pose,
double  range,
RaySensor::rayDrawMode  drawMode
[virtual]
 

registers a new sensor at the sensor bank.

The body and the pose have to be provided.

Parameters:
raysensor RaySensor to add
body body to which the sensor should be connected
pose relative position/orientation
range maximum sense range of the sensor
Returns:
index of the sensor

void reset  )  [virtual]
 

resets all sensors (used for reseting the sensor value to a value of maximal distance)

bool sense dGeomID  object  )  [virtual]
 

performs sense action of all sensors by checking collision with the given object

Returns:
true for any collision handled (sensed) and false for no interaction

void setRange double  range  )  [virtual]
 

set the range of all sensors

Parameters:
range new length of the sensors

void setRange unsigned int  index,
double  range
[virtual]
 

set the range of the specified sensor (index)

Parameters:
index index of sensor to modify
range new length of the sensor

void update  )  [virtual]
 

updates the sensor's graphical representation


Member Data Documentation

std::vector<RaySensor*> bank [protected]
 

bool initialized [protected]
 

OdeHandle odeHandle [protected]
 

OsgHandle osgHandle [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