00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CStereoServerBumblebee_H
00029 #define CStereoServerBumblebee_H
00030
00031 #include <mrpt/slam/CObservationVisualLandmarks.h>
00032 #include <mrpt/slam/CObservationStereoImages.h>
00033 #include <mrpt/vision/CStereoGrabber_Bumblebee.h>
00034 #include <mrpt/vision/utils.h>
00035 #include <mrpt/vision/CFeature.h>
00036 #include <mrpt/synch.h>
00037
00038 #include <mrpt/config.h>
00039
00040 #if MRPT_HAS_BUMBLEBEE
00041
00042 #include <digiclops.h>
00043 #include <triclops.h>
00044
00045 #endif
00046
00047 namespace mrpt
00048 {
00049 namespace vision
00050 {
00051 class MRPTDLLIMPEXP CStereoServerBumblebee
00052 {
00053 private:
00054
00055 vision::CStereoGrabber_Bumblebee *grabber;
00056
00057 mrpt::slam::CObservationStereoImages *preImgs;
00058 mrpt::slam::CObservationStereoImages *curImgs;
00059
00060 vector_float pvX, pvY, pvZ;
00061 vector_float cvX, cvY, cvZ;
00062
00063 mrpt::slam::CObservationVisualLandmarks preGrid;
00064 mrpt::slam::CObservationVisualLandmarks curGrid;
00065
00066 mrpt::slam::CObservationVisualLandmarks tmpGrid;
00067
00068
00069 vision::CFeatureList KLTListL, KLTListR;
00070 unsigned int nStereoImages;
00071 unsigned int nIter;
00072 mrpt::system::TTimeStamp lastTS;
00073
00074
00075 vision::TROI safetyZone;
00076 bool alert;
00077 mrpt::system::TTimeStamp lastTSGrid;
00078 float safetyRange;
00079
00080
00081 synch::CCriticalSection csImgs;
00082 synch::CCriticalSection csGrid;
00083 synch::CCriticalSection csList;
00084 synch::CCriticalSection csGrabber;
00085 synch::CCriticalSection csVec;
00086
00087 public:
00088
00089
00090 CStereoServerBumblebee( int cameraIndex = 0, unsigned int resolutionX = 320, unsigned int resolutionY = 240 );
00091
00092 virtual ~CStereoServerBumblebee();
00093
00094 CStereoServerBumblebee(const CStereoServerBumblebee & ) :
00095 grabber(NULL),
00096 preImgs(NULL),
00097 curImgs(NULL),
00098 pvX(), pvY(), pvZ(),
00099 cvX(), cvY(), cvZ(),
00100 preGrid(),curGrid(),tmpGrid(),KLTListL(), KLTListR(),
00101 nStereoImages(0),nIter(0),lastTS(),safetyZone(),
00102 alert(false),lastTSGrid(),safetyRange(),
00103 csImgs(),csGrid(),csList(),csGrabber(),csVec()
00104 {
00105 THROW_EXCEPTION("This class cannot be copied.");
00106 }
00107
00108 CStereoServerBumblebee & operator =(const CStereoServerBumblebee&) { THROW_EXCEPTION("This class cannot be copied."); }
00109
00110
00111
00112
00113 void monitorCaptureImgs();
00114 void monitorCaptureGrid();
00115 void monitorCaptureImgsAndGrid();
00116
00117
00118
00119 void monitorObstacleAvoidance();
00120
00121 void captureImgsAndObs();
00122
00123
00124 void getImgs( mrpt::slam::CObservationStereoImages &outImgs );
00125 void getObs( mrpt::slam::CObservationVisualLandmarks &outObs );
00126
00127 void getImgsAndObs( mrpt::slam::CObservationStereoImages &outImgs, mrpt::slam::CObservationVisualLandmarks &outGrid );
00128
00131
00133
00134
00137
00139
00140
00141 };
00142 }
00143 }
00144
00145 #endif