Skip to content

Commit

Permalink
further updates to autosaving
Browse files Browse the repository at this point in the history
  • Loading branch information
FrederikBark committed Jul 13, 2022
1 parent aec4f69 commit b7d19bf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions hector_geotiff/src/geotiff_writer/geotiff_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,22 @@ void GeotiffWriter::writeGeotiffImage(bool completed)
start_ss << std::put_time(&tm, "%Y-%m-%d");

complete_file_string = map_file_path_ + "/autosave";
std::error_code error;
if(!fs::exists(complete_file_string.c_str())) {
fs::create_directory(complete_file_string.c_str());
fs::create_directory(complete_file_string.c_str(), error);
if (error) {
ROS_ERROR("Can't create autosave folder");
return;
}
}

complete_file_string += "/" + start_ss.str();
if(!fs::exists(complete_file_string.c_str())) {
fs::create_directory(complete_file_string.c_str());
fs::create_directory(complete_file_string.c_str(), error);
if (error) {
ROS_ERROR("Can't create folder in autosave");
return;
}
}

complete_file_string += "/" + map_file_name_;
Expand Down

0 comments on commit b7d19bf

Please sign in to comment.