MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / createDirs

Function createDirs

okvis_ros/src/dataset_convertor.cpp:128–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126string colouredString(string str, string colour, string option) { return option + colour + str + RESET; }
127
128bool createDirs(string folderPath, map<string, map<string, string>> sensor_info) {
129 path p(folderPath);
130 bool res = true;
131 if (exists(p)) {
132 cout << colouredString("\tCleaning previous dataset...", RED, REGULAR);
133 remove_all(p);
134 cout << colouredString("\t[DONE!]", GREEN, REGULAR) << endl;
135 }
136
137 cout << colouredString("\tCreating dataset folder...", RED, REGULAR);
138 res = res && create_directories(p);
139 cout << colouredString("\t[DONE!]", GREEN, REGULAR) << endl;
140
141 for (auto& iterator : sensor_info) {
142 std::stringstream sensor_folder;
143 sensor_folder << folderPath;
144 if (iterator.second.find(DATADIR) != iterator.second.end()) {
145 sensor_folder << "/" << iterator.second[DATADIR];
146 } else {
147 sensor_folder << "/" << iterator.second[NAME];
148 }
149 path sensor_path(sensor_folder.str());
150
151 res = res && create_directories(sensor_path);
152 }
153
154 return res;
155}
156
157void writeCameraHeader(shared_ptr<std::ofstream> file) {
158 *file << "#timestamp [ns],"

Callers 1

mainFunction · 0.85

Calls 1

colouredStringFunction · 0.85

Tested by

no test coverage detected