ScanMap.h
Go to the documentation of this file.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
00031
00033
00034
00035 #ifndef __SCAN_MAP_H_
00036 #define __SCAN_MAP_H_
00037
00038 #ifdef MIP_HOST_APPLE
00039 #include <applePatch.h>
00040 #endif
00041
00042 #include <stdlib.h>
00043 #include <string>
00044 #include <sstream>
00045 #include <vector>
00046 #include <assert.h>
00047 #include <pthread.h>
00048
00049 #include <Scan.h>
00050 #include <Grid.h>
00051
00052
00053 namespace MipBaselib {
00054 class ScanMap{
00055 private:
00056 vector <Scan> _scans;
00057 vector <Pose> _poses;
00058 BoundBox _boundBox;
00059
00060 Grid* _grid;
00061
00062 int _size;
00063 int _numPoints;
00064 vector<bool> _bisquits;
00065
00066 void _computeBoundingBox();
00067 public:
00068
00070 ScanMap(bool useGrid=true,BoundBox gridBoundBox=BoundBox());
00071
00073 ~ScanMap(){
00074 }
00075
00079 void pushBack(Scan &scan,Pose &pose);
00080
00082 void popBack();
00083
00090 bool findNearest(Pose &pose,Scan &scan,Decimal maxLinDist,Decimal maxAngDist);
00091
00099 bool getExpectedScan(Scan &expectedScan,Pose &expectedPose, Decimal range, unsigned int samples, Angle angWidth);
00100
00104 bool save(string fileName);
00105
00109 bool load(string fileName);
00110
00113 int getSize(){
00114 return _size;
00115 }
00116
00120 void getGrid(Grid* &grid, Position& gridCenter){
00121 grid = _grid;
00122 gridCenter = _boundBox.center();
00123 }
00124
00127 int getNumPoints(){
00128 return _numPoints;
00129 }
00130
00134 int getNumPoints(int numScan);
00135
00138 Scan* getScanPointer(int numScan);
00139
00142 Pose* getPosePointer(int numPose);
00143
00145 void setBisquit(int i){
00146 _bisquits[i] = true;
00147 }
00148
00150 int createBisquit(){
00151 _bisquits.push_back(false);
00152 return _bisquits.size() - 1;
00153 }
00154
00156 bool getBisquit(int i){
00157 return _bisquits[i];
00158 }
00159
00161 void unsetBisquits(){
00162 _bisquits = vector<bool>(_bisquits.size(),false);
00163 }
00164
00167 string print();
00168 };
00169
00170
00171 };
00172
00173 #endif
00174
00175