From 0344c31e5b4185da41bfb253db720d9c91b802bd Mon Sep 17 00:00:00 2001 From: duongtd Date: Thu, 25 Dec 2025 11:06:15 +0700 Subject: [PATCH] update --- config/costmap_params.yaml | 2 +- include/costmap_2d/costmap_2d_robot.h | 1 + src/costmap_2d_robot.cpp | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/config/costmap_params.yaml b/config/costmap_params.yaml index 095cc59..f24eb96 100644 --- a/config/costmap_params.yaml +++ b/config/costmap_params.yaml @@ -17,7 +17,7 @@ costmap_2d: - name: voxel_layer type: VoxelLayer - path_plugins: ./libplugins.so + library_path: ./libplugins.so footprint: - [0.3, 0.3] - [0.3, -0.3] diff --git a/include/costmap_2d/costmap_2d_robot.h b/include/costmap_2d/costmap_2d_robot.h index cdc83f8..8c335fa 100755 --- a/include/costmap_2d/costmap_2d_robot.h +++ b/include/costmap_2d/costmap_2d_robot.h @@ -54,6 +54,7 @@ #include #include +#include class SuperValue : public XmlRpc::XmlRpcValue { public: diff --git a/src/costmap_2d_robot.cpp b/src/costmap_2d_robot.cpp index ad50750..6086daa 100644 --- a/src/costmap_2d_robot.cpp +++ b/src/costmap_2d_robot.cpp @@ -124,7 +124,10 @@ void Costmap2DROBOT::getParams(const std::string& config_file_name, robot::NodeH // check if we want a rolling window version of the costmap bool rolling_window = loadParam(layer, "rolling_window", false); bool track_unknown_space = loadParam(layer, "track_unknown_space", false); - std::string path_plugins = loadParam(layer, "path_plugins", std::string(" ")); + std::string path_plugins = loadParam(layer, "library_path", std::string(" ")); + + robot::PluginLoaderHelper loader; + if (nh.hasParam("rolling_window")) nh.getParam("rolling_window", rolling_window); @@ -132,8 +135,8 @@ void Costmap2DROBOT::getParams(const std::string& config_file_name, robot::NodeH if (nh.hasParam("track_unknown_space")) nh.getParam("track_unknown_space", track_unknown_space); - if (nh.hasParam("path_plugins")) - nh.getParam("path_plugins", path_plugins); + if (nh.hasParam("library_path")) + path_plugins = loader.findLibraryPath(name_); layered_costmap_ = new LayeredCostmap(global_frame_, rolling_window, track_unknown_space);