00001 /*!@file SeaBee/SensorResult.H information of objects to find */ 00002 // //////////////////////////////////////////////////////////////////// // 00003 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2001 by the // 00004 // University of Southern California (USC) and the iLab at USC. // 00005 // See http://iLab.usc.edu for information about this project. // 00006 // //////////////////////////////////////////////////////////////////// // 00007 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00008 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00009 // in Visual Environments, and Applications'' by Christof Koch and // 00010 // Laurent Itti, California Institute of Technology, 2001 (patent // 00011 // pending; application number 09/912,225 filed July 23, 2001; see // 00012 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00013 // //////////////////////////////////////////////////////////////////// // 00014 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00015 // // 00016 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00017 // redistribute it and/or modify it under the terms of the GNU General // 00018 // Public License as published by the Free Software Foundation; either // 00019 // version 2 of the License, or (at your option) any later version. // 00020 // // 00021 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00022 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00023 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00024 // PURPOSE. See the GNU General Public License for more details. // 00025 // // 00026 // You should have received a copy of the GNU General Public License // 00027 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00028 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00029 // Boston, MA 02111-1307 USA. // 00030 // //////////////////////////////////////////////////////////////////// // 00031 // 00032 // Primary maintainer for this file: Michael Montalbo <montalbo@usc.edu> 00033 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/SeaBee/SensorResult.H $ 00034 // $Id: SensorResult.H 10794 2009-02-08 06:21:09Z itti $ 00035 // 00036 00037 #ifndef __SENSOR_RESULT_H__ 00038 #define __SENSOR_RESULT_H__ 00039 00040 #include "Point3D.H" 00041 #include "Util/Angle.H" 00042 #include "Util/Timer.H" 00043 00044 #include "rutz/shared_ptr.h" 00045 00046 #include <pthread.h> 00047 #include <string> 00048 00049 #define NOT_FOUND_TIME 3000000 //3 seconds 00050 00051 class SensorResult 00052 { 00053 public: 00054 00055 enum SensorResultType { BUOY, 00056 PIPE, 00057 BIN, 00058 CROSS, 00059 PINGER, 00060 SALIENCY, 00061 STEREO }; 00062 00063 enum SensorResultStatus { FOUND, NOT_FOUND, LOST}; 00064 00065 SensorResult(); 00066 00067 SensorResult(SensorResultType type); 00068 00069 void copySensorResult(SensorResult sr); 00070 00071 void startTimer(); 00072 00073 void setStatus(SensorResultStatus status); 00074 00075 void setType(SensorResultType type); 00076 00077 void setPosition(Point3D pos); 00078 00079 void setOrientation(Angle ori); 00080 00081 void setFrequency(float freq); 00082 00083 void setDistance(float dist); 00084 00085 void setMass(float mass); 00086 00087 void setId(uint id); 00088 00089 void setFrameNum(uint fnum); 00090 00091 Point3D getPosition(); 00092 00093 rutz::shared_ptr<Point3D> getPositionPtr(); 00094 00095 Angle getOrientation(); 00096 00097 rutz::shared_ptr<Angle> getOrientationPtr(); 00098 00099 float getFrequency(); 00100 00101 float getDistance(); 00102 00103 float getMass(); 00104 00105 uint getId(); 00106 00107 uint getFrameNum(); 00108 00109 SensorResultType getType(); 00110 00111 SensorResultStatus getStatus(); 00112 00113 //checks if position in downward (Z,X) plane is valid 00114 bool downwardCoordsOk(); 00115 00116 //checks if position in forward (Y,X) plane is valid 00117 bool forwardCoordsOk(); 00118 00119 private: 00120 00121 pthread_mutex_t* sensorResultMutex; 00122 00123 enum SensorResultType itsType; 00124 00125 enum SensorResultStatus itsStatus; 00126 00127 Point3D itsPosition; 00128 00129 Angle itsOrientation; 00130 float itsFrequency; 00131 float itsDistance; 00132 float itsMass; 00133 00134 uint itsId; 00135 00136 uint itsFrameNumber; 00137 00138 rutz::shared_ptr<Timer> itsTimer; 00139 00140 }; 00141 00142 #endif 00143 00144 // ###################################################################### 00145 /* So things look consistent in everyone's emacs... */ 00146 /* Local Variables: */ 00147 /* indent-tabs-mode: nil */ 00148 /* End: */