There was an error while loading. Please reload this page.
2 parents 75c875f + bd16def commit 77b3563Copy full SHA for 77b3563
1 file changed
src/dlio/map.cc
@@ -12,6 +12,8 @@
12
13
#include "dlio/map.h"
14
15
+#include <filesystem>
16
+
17
dlio::MapNode::MapNode(ros::NodeHandle node_handle) : nh(node_handle) {
18
19
this->getParams();
@@ -81,6 +83,12 @@ bool dlio::MapNode::savePcd(direct_lidar_inertial_odometry::save_pcd::Request& r
81
83
float leaf_size = req.leaf_size;
82
84
std::string p = req.save_path;
85
86
+ if (!std::filesystem::is_directory(p)) {
87
+ std::cout << "Could not find directory " << p << std::endl;
88
+ res->success = false;
89
+ return;
90
+ }
91
92
std::cout << std::setprecision(2) << "Saving map to " << p + "/dlio_map.pcd"
93
<< " with leaf size " << to_string_with_precision(leaf_size, 2) << "... "; std::cout.flush();
94
0 commit comments