This commit is contained in:
duongtd 2025-12-25 11:06:15 +07:00
parent 10521c1629
commit 0344c31e5b
3 changed files with 8 additions and 4 deletions

View File

@ -17,7 +17,7 @@ costmap_2d:
- name: voxel_layer - name: voxel_layer
type: VoxelLayer type: VoxelLayer
path_plugins: ./libplugins.so library_path: ./libplugins.so
footprint: footprint:
- [0.3, 0.3] - [0.3, 0.3]
- [0.3, -0.3] - [0.3, -0.3]

View File

@ -54,6 +54,7 @@
#include <xmlrpcpp/XmlRpcValue.h> #include <xmlrpcpp/XmlRpcValue.h>
#include <robot/node_handle.h> #include <robot/node_handle.h>
#include <robot/plugin_loader_helper.h>
class SuperValue : public XmlRpc::XmlRpcValue class SuperValue : public XmlRpc::XmlRpcValue
{ {
public: public:

View File

@ -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 // check if we want a rolling window version of the costmap
bool rolling_window = loadParam(layer, "rolling_window", false); bool rolling_window = loadParam(layer, "rolling_window", false);
bool track_unknown_space = loadParam(layer, "track_unknown_space", 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")) if (nh.hasParam("rolling_window"))
nh.getParam("rolling_window", 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")) if (nh.hasParam("track_unknown_space"))
nh.getParam("track_unknown_space", track_unknown_space); nh.getParam("track_unknown_space", track_unknown_space);
if (nh.hasParam("path_plugins")) if (nh.hasParam("library_path"))
nh.getParam("path_plugins", path_plugins); path_plugins = loader.findLibraryPath(name_);
layered_costmap_ = new LayeredCostmap(global_frame_, rolling_window, track_unknown_space); layered_costmap_ = new LayeredCostmap(global_frame_, rolling_window, track_unknown_space);