44 typedef unsigned char byte;
46 int main(
int argc,
char **argv)
50 bool show_help =
false;
51 string outputFilename(
"");
52 string inputFilename(
"");
66 if(argc == 1) show_help =
true;
67 for(
int i = 1; i < argc && !show_help; i++) {
68 if(strcmp(argv[i],
"--help") == 0 || strcmp(argv[i],
"-help") == 0 ||
69 strcmp(argv[i],
"--usage") == 0 || strcmp(argv[i],
"-usage") == 0 ||
70 strcmp(argv[i],
"-h") == 0
76 cout <<
"Usage: "<<argv[0]<<
" [OPTIONS] <filename.bt>" << endl;
77 cout <<
"\tOPTIONS:" << endl;
78 cout <<
"\t -o <file> Output filename (default: first input filename + .bt)" << endl;
81 cout <<
"\t --offset <x> <y> <z>: add an offset to the octree coordinates (translation)\n";
83 cout <<
"\t --res <resolution>: set ressolution of OcTree to new value\n";
84 cout <<
"\t --scale <scale>: scale octree resolution by a value\n";
88 for(
int i = 1; i < argc; i++) {
90 if(strcmp(argv[i],
"--rotate") == 0) {
94 }
else if(strcmp(argv[i],
"-o") == 0 && i < argc - 1) {
96 outputFilename = argv[i];
98 }
else if (strcmp(argv[i],
"--bb") == 0 && i < argc - 7) {
116 }
else if (strcmp(argv[i],
"--res") == 0 && i < argc - 1) {
121 }
else if (strcmp(argv[i],
"--scale") == 0 && i < argc - 1) {
123 scale = atof(argv[i]);
126 }
else if (strcmp(argv[i],
"--offset") == 0 && i < argc - 4) {
129 offset(0) = (float) atof(argv[i]);
131 offset(1) = (float) atof(argv[i]);
133 offset(2) = (float) atof(argv[i]);
138 }
else if (i == argc-1){
139 inputFilename = string(argv[i]);
143 if (outputFilename ==
""){
144 outputFilename = inputFilename +
".edit.bt";
160 std::cout <<
"Setting new tree resolution: " << res << std::endl;
215 cout <<
"Writing octree to " << outputFilename << endl;
218 OCTOMAP_ERROR(
"Error writing tree to %s\n", outputFilename.c_str());
222 cout <<
"done" << endl << endl;
void setResolution(double r)
int main(int argc, char **argv)
bool writeBinary(const std::string &filename)
This class represents a three-dimensional vector.
#define OCTOMAP_WARNING_STR(args)
double getResolution() const
bool readBinary(std::istream &s)
#define OCTOMAP_ERROR(...)