Tekkotsu 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.

This namespace hold a few variables needed for initialization of the framework, but mainly declares variables which are used by demo behaviors. Although the variables are declared here, and some default values provided, it is up to your project to define the actual values used for your own project. This provides a way to reassign conflicts between values provided by the framework vs. those you might wish to add to your project.

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.

The "optional" variables are used by demo behaviors, and thus if you remove all of the demo behaviors, you won't need to define the corresponding interface values here.

If you want to add new ID values for your project, create a new 'globals.h' or some such in your project -- you don't need to add them here since this file is shared by all projects which use the framework, you shouldn't need to modify it for each project.


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 = NULL
 pointer to generator
FilterBankGeneratordefInterleavedYUVGenerator = NULL
 pointer to generator
JPEGGeneratordefColorJPEGGenerator = NULL
 pointer to generator
JPEGGeneratordefGrayscaleJPEGGenerator = NULL
 pointer to generator
PNGGeneratordefColorPNGGenerator = NULL
 pointer to generator
PNGGeneratordefGrayscalePNGGenerator = NULL
 pointer to generator
SegmentedColorGeneratordefSegmentedColorGenerator = NULL
 pointer to generator
RLEGeneratordefRLEGenerator = NULL
 pointer to generator
RegionGeneratordefRegionGenerator = NULL
 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 vision events from the corresponding pipeline stage or object detector
unsigned int visInterleaveSID = 0
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visColorJPEGSID = 0
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visGrayscaleJPEGSID = 1
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visColorPNGSID = 0
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visGrayscalePNGSID = 1
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visSegmentSID = 0
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visRLESID = 0
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visRegionSID = 0
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visPinkBallSID = 0
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visBlueBallSID = 1
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visGreenBallSID = 2
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visYellowBallSID = 3
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visOrangeSID = 4
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visHandSID = visOrangeSID
 synonym for visOrangeSID

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).

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
 pointer to generator
FilterBankGeneratordefInterleavedYUVGenerator
 pointer to generator
JPEGGeneratordefColorJPEGGenerator
 pointer to generator
JPEGGeneratordefGrayscaleJPEGGenerator
 pointer to generator
PNGGeneratordefColorPNGGenerator
 pointer to generator
PNGGeneratordefGrayscalePNGGenerator
 pointer to generator
SegmentedColorGeneratordefSegmentedColorGenerator
 pointer to generator
RLEGeneratordefRLEGenerator
 pointer to generator
RegionGeneratordefRegionGenerator
 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
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visInterleaveSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visColorJPEGSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visGrayscaleJPEGSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visColorPNGSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visGrayscalePNGSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visSegmentSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visRLESID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visRegionSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visPinkBallSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visBlueBallSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visGreenBallSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visYellowBallSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visOrangeSID
 source id for vision events from the corresponding pipeline stage or object detector
unsigned int visHandSID
 synonym for visOrangeSID

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
 ERS-2xx: 352*288; ERS-7 416*320 (requires non-trivial computation).
unsigned int fullLayer
 ERS-2xx: 176*144; ERS-7 208*160.
unsigned int halfLayer
 ERS-2xx: 88*72; ERS-7 104*80.
unsigned int quarterLayer
 ERS-2xx: 44*36; ERS-7 52*40.
unsigned int eighthLayer
 ERS-2xx: 22*18; ERS-7 26*20 (simply a bigger interleave referencing quarterLayer).
unsigned int sixteenthLayer
 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.
color_index defLookupColorIndexByName (const std::string &name)
 default implementation assigned to lookupColorIndexByName(); checks that defSegmentedColorGenerator is non-NULL and returns getColorIndex on it
color_index defLookupColorIndexByRgb (const rgb rgbval)
 default value initially assigned to lookupColorIndexByRgb(); checks that defSegmentedColorGenerator is non-NULL and returns getColorIndex on it
rgb defLookupColorRGB (color_index cindex)
 default implementation assigned to lookupColorRGB(); checks that defSegmentedColorGenerator is non-NULL and returns getColorRGB on it
const char * defLookupColorName (color_index cindex)
 default implementation assigned to lookupColorName(); checks that defSegmentedColorGenerator is non-NULL and returns getColorName on it
unsigned int defLookupNumColors ()
 default value initially assigned to lookupNumColors(); checks that defSegmentedColorGenerator is non-NULL and returns getNumColors on it
BehaviorBasestartupBehavior ()
 REQUIRED: you must define a behavior which will be started when the boot is complete.
color_index getColorIndex (const std::string &name)
 Returns the index corresponding to a color of specified name by calling lookupColorIndexByName().
color_index getColorIndex (const rgb rgbval)
 Returns the index corresponding to an rgb value by calling lookupColorIndexByRgb().
rgb getColorRGB (const std::string &name)
 Returns rgb value corresponding to a color of specified name by calling lookupColorRGB(lookupColorIndexByName()).
rgb getColorRGB (color_index cindex)
 Returns rgb value corresponding to a color of specified name by calling lookupColorRGB().
const char * getColorName (color_index cindex)
 Returns color name corresponding to specified color index by calling lookupColorName().
unsigned int getNumColors ()
 Returns the number of colors, obtained from defSegmentedColorGenerator.

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.
color_index(*) lookupColorIndexByName (const std::string &name) = &defLookupColorIndexByName
 allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator
color_index(*) lookupColorIndexByRgb (const rgb rgbval) = &defLookupColorIndexByRgb
 allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator
rgb(*) lookupColorRGB (color_index cindex) = &defLookupColorRGB
 allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator
const char *(*) lookupColorName (color_index cindex) = &defLookupColorName
 allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator
unsigned int(*) lookupNumColors () = &defLookupNumColors
 returns the number of indexed colors which are currently defined
bool(*) uncaughtException (const char *file, int line, const char *message, const std::exception *ex)
 The exception handler for exceptions which have fallen through to base Tekkotsu functions.
color_index(*) lookupColorIndexByName (const std::string &name)
 allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator
color_index(*) lookupColorIndexByRgb (const rgb rgbval)
 allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator
rgb(*) lookupColorRGB (color_index cindex)
 allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator
const char *(*) lookupColorName (color_index cindex)
 allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator
unsigned int(*) lookupNumColors ()
 returns the number of indexed colors which are currently defined


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 9 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)

color_index ProjectInterface::getColorIndex ( const std::string &  name  )  [inline]

Returns the index corresponding to a color of specified name by calling lookupColorIndexByName().

As per SegmentedColorGenerator::getColorIndex(), if name is not valid, return -1U

Definition at line 91 of file ProjectInterface.h.

rgb ProjectInterface::getColorRGB ( const std::string &  name  )  [inline]

Returns rgb value corresponding to a color of specified name by calling lookupColorRGB(lookupColorIndexByName()).

As per SegmentedColorGenerator::getColorRGB(), if name is not valid, return black (rgb())

Definition at line 96 of file ProjectInterface.h.

rgb ProjectInterface::getColorRGB ( color_index  cindex  )  [inline]

Returns rgb value corresponding to a color of specified name by calling lookupColorRGB().

As per SegmentedColorGenerator::getColorRGB(), if index is not valid, return black (rgb())

Definition at line 99 of file ProjectInterface.h.

const char* ProjectInterface::getColorName ( color_index  cindex  )  [inline]

Returns color name corresponding to specified color index by calling lookupColorName().

As per SegmentedColorGenerator::getColorName(), if index is not valid, return NULL

Definition at line 103 of file ProjectInterface.h.


Variable Documentation

bool(*) ProjectInterface::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.

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 30 of file ProjectInterface.cc.

Referenced by Wireless::BindCont(), Wireless::CloseCont(), Wireless::ConnectCont(), MotionManager::doAddMotion(), MotionManager::getOutputs(), Wireless::ListenCont(), IPCEventTranslator::post(), EventRouter::PostingStatus::process(), MotionManager::processMsg(), EventRouter::processTimers(), Wireless::ReceiveCont(), and Wireless::SendCont().

color_index(*) ProjectInterface::lookupColorIndexByName(const std::string &name) = &defLookupColorIndexByName

allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator

As per SegmentedColorGenerator::getColorIndex(), if name is not valid, return -1U

Definition at line 38 of file ProjectInterface.cc.

Referenced by getColorIndex(), and getColorRGB().

rgb(*) ProjectInterface::lookupColorRGB(color_index cindex) = &defLookupColorRGB

allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator

As per SegmentedColorGenerator::getColorRGB(), if index is not valid, return black (rgb())

Definition at line 55 of file ProjectInterface.cc.

Referenced by getColorRGB().

const char*(*) ProjectInterface::lookupColorName(color_index cindex) = &defLookupColorName

allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator

As per SegmentedColorGenerator::getColorRGB(), if index is not valid, return black (rgb())

Definition at line 63 of file ProjectInterface.cc.

Referenced by getColorName().

bool(*) ProjectInterface::uncaughtException(const char *file, int line, const char *message, const std::exception *ex)

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 30 of file ProjectInterface.cc.

Referenced by Wireless::BindCont(), Wireless::CloseCont(), Wireless::ConnectCont(), MotionManager::doAddMotion(), MotionManager::getOutputs(), Wireless::ListenCont(), IPCEventTranslator::post(), EventRouter::PostingStatus::process(), MotionManager::processMsg(), EventRouter::processTimers(), Wireless::ReceiveCont(), and Wireless::SendCont().

color_index(*) ProjectInterface::lookupColorIndexByName(const std::string &name)

allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator

As per SegmentedColorGenerator::getColorIndex(), if name is not valid, return -1U

Definition at line 38 of file ProjectInterface.cc.

Referenced by getColorIndex(), and getColorRGB().

rgb(*) ProjectInterface::lookupColorRGB(color_index cindex)

allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator

As per SegmentedColorGenerator::getColorRGB(), if index is not valid, return black (rgb())

Definition at line 55 of file ProjectInterface.cc.

Referenced by getColorRGB().

const char*(*) ProjectInterface::lookupColorName(color_index cindex)

allows you to override how colors are defined -- by default, this will be set to a function which passes the call to defSegmentedColorGenerator

As per SegmentedColorGenerator::getColorRGB(), if index is not valid, return black (rgb())

Definition at line 63 of file ProjectInterface.cc.

Referenced by getColorName().


Tekkotsu v3.0
Generated Fri May 11 20:09:13 2007 by Doxygen 1.4.7