#include <sensor_base.h>
Inheritance diagram for sensor_base:

Public Member Functions | |
| sensor_base (short dfc, DEGREE face, DEGREE orient, oServo *s=NULL) | |
| 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 Member Functions | |
| sensor_base (void) | |
Protected Attributes | |
| oServo * | _servo |
| FIXED_RADIAN | F_bearing |
| int | _maximum_sensor_range |
| bool | _locked |
|
||||||||||||||||||||
|
|
|
|
|
|
|
return angle at which scanner is pointed relative to local center (_face).
|
|
|
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.
|
|
|
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() |
|
|
|
|
|
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. |
|
|
Set the maximum range of the sensor.
|
|
|
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. |
|
|
Returns wether base is a scanner type or fixed.
|
|
|
Provide a servo for a scanner type sensor mount.
|
|
|
Provide emulated value. Distance from object in millimeterss.
Reimplemented in IR_base, and sonar_base. |
|
|
Distance from center of platform (MILLIMETERS).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
where the IR is facing 0 is forward + is counterclock-wise.
|
|
|
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. |
1.3