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

Service client call stops program

asked 2021-01-11 11:35:08 -0600

Heenne gravatar image

updated 2021-01-11 11:36:31 -0600


currently I have implemented a global path planner that derives from mbf_costmap_core::CostmapPlanner as I am using the move_base_flex package. While doing so I want to dynamically change the inflation_radius of the global_costmap. Therefore I tried the dynamic_reconfigure::Client but was not able to get it to work. I then found someone who achieved the reconfiguring with a service call to the .../set_parameters service. And here starts my problem, I was able to get it to work from an external node that calls the service (.../global_costmap/inflation/set_parameters) but not from my path planner class.

This is the code inside my global planner that is executed when the initialize method of my path planner is executed through move_base_flex. Problem is, that the service call always gets stuck. The program just stops there.

ROS_INFO("Dynamic reconfigure");
dynamic_reconfigure::Reconfigure dyn_reconfigure_msg;
dynamic_reconfigure::DoubleParameter param_to_reconfig; = "inflation_radius";
param_to_reconfig.value = this->formation_outline_circle_.getCircleRadius();
ROS_INFO("before call");
ros::service::call("/" + this->robot_name_ + "_ns/move_base_flex/global_costmap/inflation/set_parameters", dyn_reconfigure_msg.request,  dyn_reconfigure_msg.response);
ROS_INFO("size: %i", dyn_reconfigure_msg.response.config.doubles.size());
ROS_INFO("after call");
ROS_INFO("Dynamic reconfigure end");

This is the info that is printed in the command line:

[ INFO] [1610385999.453383279, 79.763000000]: Dynamic reconfigure
[ INFO] [1610385999.453471234, 79.763000000]: before call

I just dont understand why my program is just stopping there when calling the service. I would appreciate any help finding the solution to my problem. Thank you very much in advance and if there is any more information needed to find the problem, please feel free to ask.

Best regards


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-07-08 08:41:27 -0600

Hyunbin Park gravatar image

Hi, I had to use the thread for multiple services in my case.

edit flag offensive delete link more

Question Tools



Asked: 2021-01-11 11:35:08 -0600

Seen: 195 times

Last updated: Jan 11 '21