Update yaml_config.cpp

This commit is contained in:
XiaoTian 2024-07-05 11:24:41 +08:00 committed by GitHub
parent 20b623596f
commit bd6b891fa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,12 +2,18 @@
#include "yaml_config.h"
#include <iostream>
#include <filesystem>
YAML::Node ReadConfigYamlFile();
static std::string yaml_config_path =
"/media/Projects/guangpo_lidar/src/guangpo_lidar/yaml_config/yaml_config.yaml";
// static std::string yaml_config_path =
// "/media/Projects/guangpo_lidar/src/guangpo_lidar/yaml_config/yaml_config.yaml";
static std::string yaml_config_path = []()->std::string{
std::filesystem::path current_dir =
std::filesystem::path(__FILE__).parent_path();
std::filesystem::path yaml_path = current_dir / "yaml_config.yaml";
return yaml_path;
}();
YAML::Node yaml_config = ReadConfigYamlFile();