update file costmap_2d_robot and file config params

This commit is contained in:
2025-12-03 11:36:06 +07:00
parent 64db092d46
commit 4fb2554291
16 changed files with 169 additions and 130 deletions

View File

@@ -65,24 +65,16 @@ void StaticLayer::onInitialize()
current_ = true;
global_frame_ = layered_costmap_->getGlobalFrameID();
getParams();
std::string config_file_name = name_ + ".yaml";
getParams(config_file_name);
}
bool StaticLayer::getParams()
bool StaticLayer::getParams(const std::string& config_file_name)
{
try {
std::string config_file_name = "config.yaml";
std::string folder = COSTMAP_2D_DIR;
std::string path_source = getSourceFile(folder,config_file_name);
if(path_source != " ")
{
std::cout << "Path source: " << path_source << std::endl;
}
else
{
std::cout << "/cfg folder not found!" << std::endl;
}
YAML::Node config = YAML::LoadFile(path_source);