Fail to get current configuration from inflation_layer using dynamic_reconfigure
hi,i'm trying to use dynamic_reconfigure to change the config of inflation_layer.i am using move_base_amcl_2.5cm.launch from navigation_stage. here is my code:
using CostmapInflationCfgClient =
dynamic_reconfigure::Client<costmap_2d::InflationPluginConfig>;
int main(int argc, char **argv) {
ros::init(argc, argv, "robot_decision");
CostmapInflationCfgClient localCostmapCfgClient("/move_base_node/local_costmap/inflation_layer");
costmap_2d::InflationPluginConfig cfg;
localCostmapCfgClient.getCurrentConfiguration(cfg);
ROS_INFO("%f", cfg.cost_scaling_factor);
return 0; }
and the program just stuck here: [ INFO] [1598926418.408825819]: Waiting for configuration...
but i could set the config when chaging to these code :
// localCostmapCfgClient.getCurrentConfiguration(cfg);
cfg.cost_scaling_factor = 100;
localCostmapCfgClient.setConfiguration(cfg);
the program peforms fine:[ INFO] [1598926578.128714942]: 100.000000
The same problem happens when changing to obstacle_layer.
Do i misunderstand something?