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

logger Class Reference

Class for logging obstacle discovery. More...

#include <checkpoint.h>


Public Member Functions

 logger (void)

Static Public Member Functions

void operate (bool)
 enable logging. (off by default).

bool operate (void)
 return whether enabled.

void frequency (short)
 Set frequency of checkpoints (not obstacle detected ones).

short frequency (void)
 Return frequency of checkpoint.

bool write ()
 Returns true if a checkpoint should be taken relative to provided frequency.

word top (void)
 return current number of checkpoints. (0=none)

void checkpoint (MILLIMETER x, MILLIMETER y, DEGREE angle, CENTIMETER d, DEGREE irangle)
 log an obstacle event

void upload (void)
 upload the log through the oSCI interface (may use host SGserial class later.

void play (unsigned short time, uint8 &x, uint8 &y, RADIAN &angle, CENTIMETER &d, RADIAN &irangle)
 playback event (DOS only)

short time (unsigned short t)
 return time of next event (DOS only)

void add_checkpoint (short time, short x, short y, DEGREE angle, CENTIMETER d, DEGREE irangle)
 adds another checkpoint to structure--used in simulator to load checkpoint structure from file.


Static Private Attributes

checkpoint _checkpoints [CHECKPOINT_MAX]
word _top
bool _operate
short _frequency
short _counter


Detailed Description

Class for logging obstacle discovery.

Reference checkpoint

Operation
The motiviation for this class stems from the inability to determine how an obstacle was placed in the occupancy grid (OGrid) map. When enabled, every time an obstacle is found via mapping, an event is logged into the checkpoint log. This will usually be used concurrently with the MOS class structure. Currently, after the robot has run a mapping episode usually through a series of waypoints, the robot can be brought back to the base host station where you choice "Upload Log" from the Target menu. This initiates transfer of the log to the terminal via the oSCI class. Usually, after dumping to the terminal, I just copy the results to a seperate file for analysis.
Remarks
Not fully streamlined. For instance, still need to be able to compile this out; currently, it allows for 500 checkpoints which will take a significant amount of RAM.
:
Frequency
Currently, the frequency is obtained from persistent storage on object initialization. Otherwise, this default value can be overridden by explicityly setting the frequency.


Constructor & Destructor Documentation

logger void   ) 
 


Member Function Documentation

void add_checkpoint short  time,
short  x,
short  y,
DEGREE  angle,
CENTIMETER  d,
DEGREE  irangle
[static]
 

adds another checkpoint to structure--used in simulator to load checkpoint structure from file.

Parameters:
time index in checkpoint table of time to playback (dont use PIT time elapsed!)
x X coordinate of robot on map (Local_Map_Spec::mapx()).
y Y coordinate of robot on map (Local_Map_Spec::mapy()).
angle angle of robot on map (Local_Pose_Sensor::angle()*DEGREE_CONVERSION)
d distance to nearest obstacle in centimeters.
irangle angle of IR sensor with respect to robot (from associated sensor_base).

void checkpoint MILLIMETER  x,
MILLIMETER  y,
DEGREE  angle,
CENTIMETER  d,
DEGREE  irangle
[static]
 

log an obstacle event

Parameters:
x X coordinate of robot on map (Local_Map_Spec::mapx()).
y Y coordinate of robot on map (Local_Map_Spec::mapy()).
angle angle of robot on map (Local_Pose_Sensor::angle()*DEGREE_CONVERSION)
d distance to nearest obstacle in centimeters.
irangle angle of IR sensor with respect to robot (from associated sensor_base).

short frequency void   )  [static]
 

Return frequency of checkpoint.

void frequency short   )  [static]
 

Set frequency of checkpoints (not obstacle detected ones).

bool operate void   )  [static]
 

return whether enabled.

void operate bool   )  [static]
 

enable logging. (off by default).

void play unsigned short  time,
uint8 &  x,
uint8 &  y,
RADIAN &  angle,
CENTIMETER d,
RADIAN &  irangle
[static]
 

playback event (DOS only)

Parameters:
time index in checkpoint table of time to playback (dont use PIT time elapsed!)
x X coordinate of robot on map (Local_Map_Spec::mapx()).
y Y coordinate of robot on map (Local_Map_Spec::mapy()).
angle angle of robot on map (Local_Pose_Sensor::angle()*DEGREE_CONVERSION)
d distance to nearest obstacle in centimeters.
irangle angle of IR sensor with respect to robot (from associated sensor_base).

short time unsigned short  t  )  [static]
 

return time of next event (DOS only)

Parameters:
t time elapsed as measured by the PIT interrupt count that next obstacle was detected.

word top void   )  [static]
 

return current number of checkpoints. (0=none)

void upload void   )  [static]
 

upload the log through the oSCI interface (may use host SGserial class later.

bool write  )  [static]
 

Returns true if a checkpoint should be taken relative to provided frequency.

At first the internal oSchedule::timestamp was going to be used, but the time slices sometimes resulted in a timestamp always being an odd number (1,3,5,etc.); thus a frequency of 4 would never be executed. A simple alternative is simply to have an internal counter and compare the frequency with this number--thus you take a checkpoint every Nth scheduled checkpoint.


Field Documentation

struct checkpoint _checkpoints[CHECKPOINT_MAX] [static, private]
 

short _counter [static, private]
 

short _frequency [static, private]
 

bool _operate [static, private]
 

word _top [static, private]
 


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