Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

almStructures.h

Go to the documentation of this file.
00001 /*
00002  * almStructures.h -- contains definitions for data structures used in the
00003  *   AIBO Local Map. Also, hm_cell is used in the global map as well.
00004  *
00005  * Started 12-12-2002, tss
00006  */
00007 
00008 #ifndef _ALM_STRUCTURES_H_
00009 #define _ALM_STRUCTURES_H_
00010 
00011 #ifndef UNIT_TEST
00012 #include "Vision/Vision.h"
00013 #include "Vision/Visiondefines.h"
00014 #endif
00015 
00016 // Tekkotsu's segmented color type is an int. Our code was just using the dorky
00017 // enum below, but now that we've integrated, it's an int.
00018 #ifndef UNIT_TEST
00019 typedef int colortype;
00020 #else
00021 typedef enum { RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET } colortype;
00022 #endif
00023 
00024 //! A cell for the spherical depth map
00025 typedef struct _dm_cell {
00026   float depth;    //!< depth in millimeters
00027   float confidence; //!< 0 to 1 confidence value in cell data
00028   colortype color;  //!< The color of the object in this cell as seen from
00029       //!< the camera.
00030   int cluster;    //!< K-means uncertainty clustering. (Internal use only)
00031 } dm_cell;
00032 
00033 //! A cell for the horizontal height map
00034 typedef struct _hm_cell {
00035   float height;   //!< height in millimeters; ground is 0
00036   float trav;   //!< 0 to 1 estimate of cell traverability (1=yes)
00037   float confidence; //!< 0 to 1 confidence value in cell data
00038   colortype color;  //!< The color of the object in this cell as seen from
00039       //!< the camera.
00040   int cluster;    //!< K-means uncertainty clustering. (Internal use only)
00041 } hm_cell;
00042 
00043 // Pickers--abstract base class for classes that pick certain attributes
00044 // out of dm_cells and hm_cells. Useful for dumping data with the several
00045 // dump routines.
00046 //   Yeah, templates probably could work better here.
00047 //   PS: everything gets converted to float
00048 
00049 //! @name Pickers
00050 //! Pickers are handy routines that extract certain types of data from
00051 //! hm_cell and dm_cell structs. They're used by the map accessor functions
00052 //! in WorldModel2 to furnish the user with desired map data--the user simply
00053 //! passes in a Picker, and they get the data back (as float only). Chances are
00054 //! there's a better template-based solution to this problem.
00055 //@{
00056 //! Abstract base class for height map data pickers. Implementations available.
00057 struct hmPicker {
00058   //!functor - TSS_TODO
00059   virtual float operator() (hm_cell &c) const = 0;
00060 };
00061 //! Abstract base class for depth map data pickers. Implementations available.
00062 struct dmPicker {
00063   //!functor - TSS_TODO
00064   virtual float operator() (dm_cell &c) const = 0;
00065 };
00066 
00067 //! Picks height measurements out of the HHM or GHM.
00068 struct hmPickHeight : public hmPicker {
00069   //!functor - TSS_TODO
00070   virtual float operator() (hm_cell &c) const { return c.height; }
00071 };
00072 //! Picks traversability values out of the HHM or GHM.
00073 struct hmPickTrav : public hmPicker {
00074   //!functor - TSS_TODO
00075   virtual float operator() (hm_cell &c) const { return c.trav; }
00076 };
00077 //! Picks confidence values out of the HHM or GHM.
00078 struct hmPickConfidence : public hmPicker {
00079   //!functor - TSS_TODO
00080   virtual float operator() (hm_cell &c) const { return c.confidence; }
00081 };
00082 //! Picks color measurements out of the HHM or GHM.
00083 struct hmPickColor : public hmPicker {
00084   //!functor - TSS_TODO
00085   virtual float operator() (hm_cell &c) const { return c.color; }
00086 };
00087 //! Picks cluster membership out of the HHM or GHM. For completeness--not use!
00088 struct hmPickCluster : public hmPicker {
00089   //!functor - TSS_TODO
00090   virtual float operator() (hm_cell &c) const { return c.cluster; }
00091 };
00092 
00093 //! Picks depth measurements out of the SDM.
00094 struct dmPickDepth : public dmPicker {
00095   //!functor - TSS_TODO
00096   virtual float operator() (dm_cell &c) const { return c.depth; }
00097 };
00098 //! Picks confidence values out of the SDM.
00099 struct dmPickConfidence : public dmPicker {
00100   //!functor - TSS_TODO
00101   virtual float operator() (dm_cell &c) const { return c.confidence; }
00102 };
00103 //! Picks color measurements out of the SDM.
00104 struct dmPickColor : public dmPicker {
00105   //!functor - TSS_TODO
00106   virtual float operator() (dm_cell &c) const { return c.color; }
00107 };
00108 //! Picks cluster membership out of the SDM. For completeness--not use!
00109 struct dmPickCluster : public dmPicker {
00110   //!functor - TSS_TODO
00111   virtual float operator() (dm_cell &c) const { return c.cluster; }
00112 };
00113 //@}
00114 #endif

Tekkotsu v1.4
Generated Sat Jul 19 00:06:29 2003 by Doxygen 1.3.2