Main Page   Hardware Class Hierarchy   Hardware API     Mapping Class Hierarchy  Mapping API 

Range_Sensor Class Reference

[Ref. JAUS component ID 50] This component reports range data to requesting components. The range data is measured relative to the platform coordinate system at the time reported. More...

#include <range_sensor.h>

Inheritance diagram for Range_Sensor:

sensor_base RS_GUI

Public Member Functions

 Range_Sensor (short dfc, DEGREE face, DEGREE rot, oServo *s=NULL)
 Constructor for range sensor.

MILLIMETER range (void)
 Return nearest obstacle.

void range (MILLIMETER)
 Set distance to nearest obstacle (may eliminate and just make the IR sensor routines friends).

void scanner (oServo *s)
 Provide a servo for a scanner type sensor mount.

bool scanner (void)
 Returns wether base is a scanner type or fixed.

void angle (DEGREE d)
 Sets the angle that the base is facing relative to _face; i.e., if mounted 20 degrees from center, then 0 is 20 degrees from center. If defined with a servo, then will turn the base to that direction.

DEGREE angle (void)
 return angle at which scanner is pointed relative to local center (_face).

FIXED_RADIAN bearing (void)
 Returns current facing of sensor taking into account scanner rotation (FIXED).

int maximum_sensor_range (void)
 Returns the maximum sensor range in millimetres.

void maximum_sensor_range (int msr)
 Set the maximum range of the sensor.

bool locked (void)
 Returns whether the sensor is locked.

void locked (bool l)
short value (void)
 Provide emulated value. Distance from object in millimeterss.


Data Fields

int _DFC
 Distance from center of platform (MILLIMETERS).

FIXED_RADIAN F_face
 where the IR is facing 0 is forward + is counterclock-wise.

FIXED_RADIAN F_orient
 Position (radians) around the robot from defined center position (0=forward).


Protected Attributes

oServo_servo
FIXED_RADIAN F_bearing
int _maximum_sensor_range
bool _locked

Private Attributes

MILLIMETER _range

Detailed Description

[Ref. JAUS component ID 50] This component reports range data to requesting components. The range data is measured relative to the platform coordinate system at the time reported.

Currently a placeholder for JAUS compliance. Maybe should rename sensor_base to range_sensor?


Constructor & Destructor Documentation

Range_Sensor short  dfc,
DEGREE  face,
DEGREE  rot,
oServo s = NULL
 

Constructor for range sensor.

Parameters:
dfc - distance from center of robot (MILLIMETER)
face - where sensor is facing (DEGREE)
rot - how many degrees the robot the sensor is located (DEGREE).
s - optional servo to create a scanner type sensor.


Member Function Documentation

DEGREE angle void   )  [inherited]
 

return angle at which scanner is pointed relative to local center (_face).

void angle DEGREE  d  )  [inherited]
 

Sets the angle that the base is facing relative to _face; i.e., if mounted 20 degrees from center, then 0 is 20 degrees from center. If defined with a servo, then will turn the base to that direction.

FIXED_RADIAN bearing void   )  [inherited]
 

Returns current facing of sensor taking into account scanner rotation (FIXED).

bearing is Absolute direction of sensor with respect to robot's forward as 0 degrees; it incorporates the facing of sensor. To get the bearing with respect to the world system, you must add the robot's current heading; i.e., bearing() + angle()

void locked bool  l  )  [inherited]
 

bool locked void   )  [inherited]
 

Returns whether the sensor is locked.

This is a locking mechanism if you wish to allocate a sensor for a private use and cannot be allocated by another call to Object_List::bearing until it is unlocked.

void maximum_sensor_range int  msr  )  [inherited]
 

Set the maximum range of the sensor.

int maximum_sensor_range void   )  [inherited]
 

Returns the maximum sensor range in millimetres.

maximum sensor_range declared below so it can be initialized low level, but returns a low level so a generic <sensor_base*> can access maximum sensor range without knowing its type.

void range MILLIMETER   ) 
 

Set distance to nearest obstacle (may eliminate and just make the IR sensor routines friends).

MILLIMETER range void   ) 
 

Return nearest obstacle.

bool scanner void   )  [inherited]
 

Returns wether base is a scanner type or fixed.

void scanner oServo s  )  [inherited]
 

Provide a servo for a scanner type sensor mount.

short value void   )  [inherited]
 

Provide emulated value. Distance from object in millimeterss.

Reimplemented in IR_base, and sonar_base.


Field Documentation

int _DFC [inherited]
 

Distance from center of platform (MILLIMETERS).

bool _locked [protected, inherited]
 

int _maximum_sensor_range [protected, inherited]
 

MILLIMETER _range [private]
 

oServo* _servo [protected, inherited]
 

FIXED_RADIAN F_bearing [protected, inherited]
 

FIXED_RADIAN F_face [inherited]
 

where the IR is facing 0 is forward + is counterclock-wise.

FIXED_RADIAN F_orient [inherited]
 

Position (radians) around the robot from defined center position (0=forward).

To put it another way, this is where the sensor is mounted whereas face is which way IR beam is directed; no necessarily related.


Generated on Mon Oct 8 19:32:27 2007 for OOMRM Mapping API by doxygen1.3