Robotsystem from Robot Group Leipzig: RaySensorBank Class Reference

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

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

# RaySensorBank Class Reference

`#include <raysensorbank.h>`

Collaboration diagram for RaySensorBank:

[legend]
List of all members.

## Detailed Description

Class for a bank of ray sensors.

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

Definition at line 55 of file raysensorbank.h.

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

## Constructor & Destructor Documentation

RaySensorBank | ( |  | ) |

| Definition at line 54 of file raysensorbank.cpp.

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

| Definition at line 58 of file raysensorbank.cpp.

## Member Function Documentation

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

| Definition at line 118 of file raysensorbank.cpp.

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 Definition at line 98 of file raysensorbank.cpp.

double get | ( | unsigned int | index | ) | `[virtual]`

| returns the sensor value of the given sensor (usually in the range [-1,1] ) Definition at line 93 of file raysensorbank.cpp.

dSpaceID getSpaceID | ( |  | ) | `[virtual]`

| returns the spaceID of the sensor space Definition at line 107 of file raysensorbank.cpp.

void init | ( | const OdeHandle & | odeHandle,
|  | const OsgHandle & | osgHandle
| ) | `[virtual]`

| initialises sensor bank with handles for ode and osg Definition at line 62 of file raysensorbank.cpp.

virtual 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) Definition at line 77 of file raysensorbank.cpp.

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 Definition at line 83 of file raysensorbank.cpp.

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

| updates the sensor's graphical representation Definition at line 111 of file raysensorbank.cpp.

## Member Data Documentation

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

| Definition at line 108 of file raysensorbank.h.

bool initialized`[protected]`

| Definition at line 109 of file raysensorbank.h.

OdeHandle odeHandle`[protected]`

| Definition at line 111 of file raysensorbank.h.

OsgHandle osgHandle`[protected]`

| Definition at line 112 of file raysensorbank.h.