Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ProjectInterface Namespace Reference


Detailed Description

A collection of the global variables which should be set by a project to use the Tekkotsu framework.

You don't necessarily need to define all of these, but if you want to use the built in demo behaviors, you may need to set some values in here appropriately so that the demos can adapt to your project's configuration.

Any references should be instantiated in your own project files (since you can't reassign a reference)

Any pointers are instantiated in ProjectInterface.cc and initialized to NULL. You can reassign them as you see fit.

Currently, all required members are references (so they can't be set to NULL and you'll get errors if you leave them out) and all optional settings are pointers so you can ignore them if you want.


Vision Setup

A collection of the various stages of vision processing. None of these are absolutely required, but are needed to run included demo behaviors and TekkotsuMon modules

FilterBankGeneratordefRawCameraGenerator = 0
 pointer to generator
FilterBankGeneratordefInterleavedYUVGenerator = 0
 pointer to generator
JPEGGeneratordefColorJPEGGenerator = 0
 pointer to generator
JPEGGeneratordefGrayscaleJPEGGenerator = 0
 pointer to generator
SegmentedColorGeneratordefSegmentedColorGenerator = 0
 pointer to generator
RLEGeneratordefRLEGenerator = 0
 pointer to generator
RegionGeneratordefRegionGenerator = 0
 pointer to generator

Vision SIDs

Default source IDs for the various generators; These are given default values, but you can reassign them if you like.

unsigned int visRawCameraSID = 0
 source id for event
unsigned int visInterleaveSID = 0
 source id for event
unsigned int visColorJPEGSID = 0
 source id for event
unsigned int visGrayscaleJPEGSID = 1
 source id for event
unsigned int visSegmentSID = 0
 source id for event
unsigned int visRLESID = 0
 source id for event
unsigned int visRegionSID = 0
 source id for event
unsigned int visPinkBallSID = 0
 source id for event
unsigned int visBlueBallSID = 1
 source id for event
unsigned int visHandSID = 2
 source id for event

Layer Resolutions

Allows you to request a particular layer abstractly - this isn't used by the framework, just a suggestion for clarity

unsigned int doubleLayer = 5
 ERS-2xx: 352*288; ERS-7 416*320 (requires non-trivial computation).
unsigned int fullLayer = 4
 ERS-2xx: 176*144; ERS-7 208*160.
unsigned int halfLayer = 3
 ERS-2xx: 88*72; ERS-7 104*80.
unsigned int quarterLayer = 2
 ERS-2xx: 44*36; ERS-7 52*40.
unsigned int eighthLayer = 1
 ERS-2xx: 22*18; ERS-7 26*20 (simply a bigger interleave referencing quarterLayer).
unsigned int sixteenthLayer = 0
 ERS-2xx: 11*9; ERS-7 13*10 (simply a bigger interleave referencing quarterLayer).

Functions

bool displayException (const char *file, int line, const char *message, const std::exception *ex)
 Displays information about an exception on serr, provides a default value for uncaughtException.
BehaviorBasestartupBehavior ()
 REQUIRED: you must define a behavior which will be started when the boot is complete.

Variables

bool(* uncaughtException )(const char *file, int line, const char *message, const std::exception *ex) = &displayException
 The exception handler for exceptions which have fallen through to base Tekkotsu functions.


Function Documentation

bool ProjectInterface::displayException const char *  file,
int  line,
const char *  message,
const std::exception *  ex
 

Displays information about an exception on serr, provides a default value for uncaughtException.

You can call this directly from your own code any time you would like an exception error message.

Parameters:
file The file where the exception was caught (usually just pass __FILE__), or NULL
line The line number where the exception was caught (usually just pass __LINE__), if file is NULL, line is ignored
message An addition message, or NULL
ex The exception which was caught, or NULL if it is was not a std::exception subclass
Returns:
true, indicating the exception was handled adequately

Definition at line 7 of file ProjectInterface.cc.

BehaviorBase& ProjectInterface::startupBehavior  ) 
 

REQUIRED: you must define a behavior which will be started when the boot is complete.

This is similar in idea to the Linux init process - it should do some basic initialization and then launch any other behavior you would like to run at boot. To avoid static initialization ordering issues, this is a function which will be called after environment setup is complete, which should then return a behavior to use as the startup behavior. This behavior should not be reference counted, and probably makes most sense to implement as a static local variable of the function. (Each call should return the same behavior)


Variable Documentation

JPEGGenerator * ProjectInterface::defColorJPEGGenerator = 0
 

pointer to generator

Definition at line 30 of file ProjectInterface.cc.

Referenced by CameraBehavior::processEvent().

JPEGGenerator * ProjectInterface::defGrayscaleJPEGGenerator = 0
 

pointer to generator

Definition at line 31 of file ProjectInterface.cc.

Referenced by CameraBehavior::processEvent().

FilterBankGenerator * ProjectInterface::defInterleavedYUVGenerator = 0
 

pointer to generator

Definition at line 29 of file ProjectInterface.cc.

Referenced by CameraBehavior::processEvent().

FilterBankGenerator * ProjectInterface::defRawCameraGenerator = 0
 

pointer to generator

Definition at line 28 of file ProjectInterface.cc.

Referenced by CameraBehavior::processEvent().

RegionGenerator * ProjectInterface::defRegionGenerator = 0
 

pointer to generator

Definition at line 34 of file ProjectInterface.cc.

RLEGenerator * ProjectInterface::defRLEGenerator = 0
 

pointer to generator

Definition at line 33 of file ProjectInterface.cc.

Referenced by DrawVisObjBoundBehavior::processEvent().

SegmentedColorGenerator * ProjectInterface::defSegmentedColorGenerator = 0
 

pointer to generator

Definition at line 32 of file ProjectInterface.cc.

unsigned int ProjectInterface::doubleLayer = 5
 

ERS-2xx: 352*288; ERS-7 416*320 (requires non-trivial computation).

Definition at line 53 of file ProjectInterface.cc.

Referenced by CameraBehavior::processEvent().

unsigned int ProjectInterface::eighthLayer = 1
 

ERS-2xx: 22*18; ERS-7 26*20 (simply a bigger interleave referencing quarterLayer).

Definition at line 57 of file ProjectInterface.cc.

unsigned int ProjectInterface::fullLayer = 4
 

ERS-2xx: 176*144; ERS-7 208*160.

Definition at line 54 of file ProjectInterface.cc.

unsigned int ProjectInterface::halfLayer = 3
 

ERS-2xx: 88*72; ERS-7 104*80.

Definition at line 55 of file ProjectInterface.cc.

unsigned int ProjectInterface::quarterLayer = 2
 

ERS-2xx: 44*36; ERS-7 52*40.

Definition at line 56 of file ProjectInterface.cc.

unsigned int ProjectInterface::sixteenthLayer = 0
 

ERS-2xx: 11*9; ERS-7 13*10 (simply a bigger interleave referencing quarterLayer).

Definition at line 58 of file ProjectInterface.cc.

bool(* ProjectInterface::uncaughtException = &displayException
 

The exception handler for exceptions which have fallen through to base Tekkotsu functions.

You can override this to install your own handler by assigning a new function. This defaults to displayException(), which does not call abort() (which would otherwise be the default if the exception fell through).

Parameters:
file The file where the exception was caught (usually just pass __FILE__), or NULL
line The line number where the exception was caught (usually just pass __LINE__), if file is NULL, line is ignored
message An addition message, or NULL
ex The exception which was caught, or NULL if it is was not a std::exception subclass
Returns:
true if the exception was handled, false if the exception should be rethrown

Definition at line 25 of file ProjectInterface.cc.

Referenced by Wireless::BindCont(), Wireless::CloseCont(), Wireless::ConnectCont(), EventRouter::doSendEvent(), Wireless::ListenCont(), EventRouter::processTimers(), Wireless::ReceiveCont(), and Wireless::SendCont().

unsigned int ProjectInterface::visBlueBallSID = 1
 

source id for event

Definition at line 50 of file ProjectInterface.cc.

unsigned int ProjectInterface::visColorJPEGSID = 0
 

source id for event

Definition at line 40 of file ProjectInterface.cc.

Referenced by RawCamBehavior::DoStart().

unsigned int ProjectInterface::visGrayscaleJPEGSID = 1
 

source id for event

Definition at line 41 of file ProjectInterface.cc.

Referenced by RawCamBehavior::DoStart().

unsigned int ProjectInterface::visHandSID = 2
 

source id for event

Definition at line 51 of file ProjectInterface.cc.

unsigned int ProjectInterface::visInterleaveSID = 0
 

source id for event

Definition at line 38 of file ProjectInterface.cc.

unsigned int ProjectInterface::visPinkBallSID = 0
 

source id for event

Definition at line 49 of file ProjectInterface.cc.

Referenced by StareAtBallBehavior::DoStart(), ChaseBallBehavior::DoStart(), BanditMachine::WaitNode::DoStart(), and PaceTargetsMachine::setup().

unsigned int ProjectInterface::visRawCameraSID = 0
 

source id for event

Definition at line 36 of file ProjectInterface.cc.

Referenced by StareAtPawBehavior2::DoStart(), RawCamBehavior::DoStart(), DrawVisObjBoundBehavior::DoStart(), and DrawSkeletonBehavior::DoStart().

unsigned int ProjectInterface::visRegionSID = 0
 

source id for event

Definition at line 47 of file ProjectInterface.cc.

Referenced by RegionCamBehavior::DoStart().

unsigned int ProjectInterface::visRLESID = 0
 

source id for event

Definition at line 45 of file ProjectInterface.cc.

Referenced by SegCamBehavior::DoStart().

unsigned int ProjectInterface::visSegmentSID = 0
 

source id for event

Definition at line 43 of file ProjectInterface.cc.

Referenced by SegCamBehavior::DoStart(), and DrawVisObjBoundBehavior::DoStart().


Tekkotsu v2.4.1
Generated Tue Aug 16 16:35:15 2005 by Doxygen 1.4.4