00001 // 00002 // SfMonteLaser.h 00003 // 00004 // monte carlo localization with a laser class definitions 00005 00006 // 00007 // Copyright 1999 by Kurt Konolige 00008 // 00009 // The author hereby grants to SRI permission to use this software. 00010 // The author also grants to SRI permission to distribute this software 00011 // to schools for non-commercial educational use only. 00012 // 00013 // The author hereby grants to other individuals or organizations 00014 // permission to use this software for non-commercial 00015 // educational use only. This software may not be distributed to others 00016 // except by SRI, under the conditions above. 00017 // 00018 // Other than these cases, no part of this software may be used or 00019 // distributed without written permission of the author. 00020 // 00021 // Neither the author nor SRI make any representations about the 00022 // suitability of this software for any purpose. It is provided 00023 // "as is" without express or implied warranty. 00024 // 00025 // Kurt Konolige 00026 // Senior Computer Scientist 00027 // SRI International 00028 // 333 Ravenswood Avenue 00029 // Menlo Park, CA 94025 00030 // E-mail: konolige@ai.sri.com 00031 00032 #ifndef SFMONTELASER_H 00033 #define SFMONTELASER_H 00034 00035 #include "export.h" 00036 00062 00064 void mcLrfInit(); 00066 void mcLrfInitRes(int res); 00068 void mcLrfScanInit(); 00070 void mcLoadScanMap(char *name); 00071 00074 // 00075 // Subclass SfCorrSamples -- uses correlation as posterior 00076 // probability calculation 00077 // Used with LRF currently, but could be used with sonars, 00078 // given the grid contains wall angles 00079 // 00080 // For map creation, AddCumulative() puts the current cumulative 00081 // distribution into the grid 00082 // 00083 00084 class SfCorrSamples : public SfSamples 00085 { 00086 public: 00087 // number of samples, size of grid, sensor device 00088 SfCorrSamples(int num, SfVector &s, SfRangeDevice *dev); 00089 void PostProbInit(); // set up LRF readings 00090 void PostProb(SfPoseP *p, int n); // posterior prob calculation 00091 virtual void DoMapUpdate(); // adds in current LRF cumulative 00092 void AddMapCurrent(); // for map building 00093 00094 void SetSensor(SfRangeDevice *sr) // set up which sensor to use 00095 { sensor = sr; } 00096 SfRangeDevice *GetSensor() { return sensor; } 00097 00098 int dist; // minimum distance filter 00099 00100 private: 00101 double *xx, *yy; // point buffers 00102 int numreadings; // how many we have 00103 SfRangeDevice *sensor; // which sensor we're using 00104 }; 00105 00106 #endif // SFMONTELASER_H