add slam_gmapping

This commit is contained in:
X-lanni
2025-06-06 16:15:07 +08:00
parent 9187b9fb85
commit a7b75c31cb
141 changed files with 15992 additions and 0 deletions
@@ -0,0 +1,19 @@
#include <fstream>
#include <iostream>
#include <sstream>
#include <unistd.h>
using namespace std;
ostream& printpgm(ostream& os, int xsize, int ysize, const double * const * matrix){
if (!os)
return os;
os<< "P5" << endl << xsize << endl << ysize << endl << 255 << endl;
for (int y=ysize-1; y>=0; y--){
for (int x=0;x<xsize; x++){
unsigned char c=(unsigned char)(255*fabs(1.-matrix[x][y]));
os.put(c);
}
}
return os;
}