Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Move Base: rosservice hangs

Hi all, i am currently use the navigation stack to navigate my robot. Due to some problems with the local costmap, i want to dynamically set the resolution of the grid in my cpp code. However, when i call the rosservice /move_base/local_costmap/set_parameters, the service hangs. Any operation run in the same thread is blocked after the service is called. I use the following code for calling the service:

       dynamic_reconfigure::ReconfigureRequest srv_req;
       dynamic_reconfigure::ReconfigureResponse srv_resp;
       dynamic_reconfigure::DoubleParameter double_param;
       dynamic_reconfigure::Config conf;
       double_param.name = "resolution";
       double_param.value = 0.3;
       conf.doubles.push_back(double_param);
       srv_req.config = conf;
       ros::service::call("/move_base/local_costmap/set_parameters", srv_req, srv_resp);

Weirdly enough, i am able to change parameters in /move_base/local_costmap/obstacle_layer/set_parameters (in the same part in my project). Also, the service is being recognized.

Thanks in advance,