ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Fail to get current configuration from inflation_layer using dynamic_reconfigure

asked 2020-08-31 21:23:44 -0500

zhazha gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-09-22 15:01:27 -0500

Andrew xXx gravatar image

Hi, please can you publish/edit in your message full C++ code and other commands to reproduce this behaviour

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-08-31 21:23:44 -0500

Seen: 193 times

Last updated: Sep 22 '20