Ask Your Question
1

Fail to get current configuration from inflation_layer using dynamic_reconfigure

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

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 -0600

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 82 times

Last updated: Sep 22 '20