Robotics StackExchange | Archived questions

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 /movebase/localcostmap/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 /movebase/localcostmap/obstaclelayer/setparameters (in the same part in my project). Also, the service is being recognized.

Thanks in advance,

Asked by Robinros on 2017-07-12 05:12:48 UTC

Comments

Answers

Try using waitForService() before calling it? More info here.

Asked by Procópio on 2017-07-17 02:44:34 UTC

Comments