Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ProjectInterface.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ProjectInterface_h_
00003 #define INCLUDED_ProjectInterface_h_
00004 
00005 class BehaviorBase;
00006 class FilterBankGenerator;
00007 class SegmentedColorGenerator;
00008 class RLEGenerator;
00009 class RegionGenerator;
00010 class JPEGGenerator;
00011 namespace std {
00012   class exception;
00013 }
00014 
00015 //! A collection of the global variables which should be set by a project to use the Tekkotsu framework
00016 /*! You don't necessarily need to define all of these, but if you want
00017  *  to use the built in demo behaviors, you may need to set some
00018  *  values in here appropriately so that the demos can adapt to your
00019  *  project's configuration.
00020  *  
00021  *  Any references should be instantiated in your own project files
00022  *  (since you can't reassign a reference)
00023  *
00024  *  Any pointers are instantiated in ProjectInterface.cc and
00025  *  initialized to NULL. You can reassign them as you see fit.
00026  *
00027  *  Currently, all required members are references (so they can't be
00028  *  set to NULL and you'll get errors if you leave them out) and all
00029  *  optional settings are pointers so you can ignore them if you want.
00030  */
00031 namespace ProjectInterface {
00032   
00033   //! REQUIRED: you must define a behavior which will be started when the boot is complete
00034   /*! This is similar in idea to the Linux init process - it should do
00035    *  some basic initialization and then launch any other behavior you
00036    *  would like to run at boot.
00037    *  To avoid static initialization ordering issues, this is a function
00038    *  which will be called after environment setup is complete, which
00039    *  should then return a behavior to use as the startup behavior.
00040    *  This behavior should not be reference counted, and probably makes
00041    *  most sense to implement as a static local variable of the function.
00042    *  (Each call should return the same behavior) */
00043   BehaviorBase& startupBehavior();
00044 
00045   //! The exception handler for exceptions which have fallen through to base Tekkotsu functions
00046   /*! You can override this to install your own handler by assigning a
00047    *  new function.  This defaults to displayException(), which
00048    *  <b>does not</b> call abort() (which would otherwise be the
00049    *  default if the exception fell through).
00050    *  @param file The file where the exception was caught (usually just pass __FILE__), or NULL
00051    *  @param line The line number where the exception was caught (usually just pass __LINE__), if @a file is NULL, @a line is ignored
00052    *  @param message An addition message, or NULL
00053    *  @param ex The exception which was caught, or NULL if it is was not a std::exception subclass
00054    *  @return true if the exception was handled, false if the exception should be rethrown */
00055   extern bool (*uncaughtException)(const char * file, int line, const char * message, const std::exception* ex);
00056 
00057   //! Displays information about an exception on #serr, provides a default value for #uncaughtException
00058   /*! You can call this directly from your own code any time you would like an exception error message.
00059    *  @param file The file where the exception was caught (usually just pass __FILE__), or NULL
00060    *  @param line The line number where the exception was caught (usually just pass __LINE__), if @a file is NULL, @a line is ignored
00061    *  @param message An addition message, or NULL
00062    *  @param ex The exception which was caught, or NULL if it is was not a std::exception subclass
00063    *  @return true, indicating the exception was handled adequately */
00064   bool displayException(const char * file, int line, const char * message, const std::exception* ex);
00065 
00066   //! 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
00067   /*! @name Vision Setup */
00068   //! pointer to generator
00069   extern FilterBankGenerator * defRawCameraGenerator;
00070   extern FilterBankGenerator * defInterleavedYUVGenerator;
00071   extern JPEGGenerator * defColorJPEGGenerator;
00072   extern JPEGGenerator * defGrayscaleJPEGGenerator;
00073   extern SegmentedColorGenerator * defSegmentedColorGenerator;
00074   extern RLEGenerator * defRLEGenerator;
00075   extern RegionGenerator * defRegionGenerator;
00076   //@}
00077 
00078   //! Default source IDs for the various generators; These are given default values, but you can reassign them if you like.
00079   /*! @name Vision SIDs */
00080   //! source id for event
00081   extern unsigned int visRawCameraSID;
00082   extern unsigned int visInterleaveSID;
00083   extern unsigned int visColorJPEGSID;
00084   extern unsigned int visGrayscaleJPEGSID;
00085   extern unsigned int visSegmentSID;
00086   extern unsigned int visRLESID;
00087   extern unsigned int visRegionSID;
00088   extern unsigned int visPinkBallSID;
00089   extern unsigned int visBlueBallSID;
00090   extern unsigned int visHandSID;
00091   //@}
00092 
00093   //! Allows you to request a particular layer abstractly - this isn't used by the framework, just a suggestion for clarity
00094   /*! @name Layer Resolutions */
00095   extern unsigned int doubleLayer;   //!< ERS-2xx: 352*288; ERS-7 416*320 (requires non-trivial computation)
00096   extern unsigned int fullLayer;     //!< ERS-2xx: 176*144; ERS-7 208*160
00097   extern unsigned int halfLayer;     //!< ERS-2xx: 88*72; ERS-7 104*80
00098   extern unsigned int quarterLayer;  //!< ERS-2xx: 44*36; ERS-7 52*40
00099   extern unsigned int eighthLayer;   //!< ERS-2xx: 22*18; ERS-7 26*20 (simply a bigger interleave referencing quarterLayer)
00100   extern unsigned int sixteenthLayer;//!< ERS-2xx: 11*9; ERS-7 13*10 (simply a bigger interleave referencing quarterLayer)
00101   //@}
00102 }
00103 
00104 /*! @file
00105  * @brief Defines ProjectInterface namespace - a collection of the global variables which should be set by a project to use the Tekkotsu framework
00106  * @author ejt (Creator)
00107  *
00108  * $Author: ejt $
00109  * $Name: tekkotsu-2_4_1 $
00110  * $Revision: 1.8 $
00111  * $State: Exp $
00112  * $Date: 2005/08/16 18:00:17 $
00113  */
00114 
00115 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:48 2005 by Doxygen 1.4.4