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

Move Base: rosservice hangs

asked 2017-07-12 05:12:48 -0500

Robinros gravatar image

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; = "resolution";
       double_param.value = 0.3;
       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,

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-07-17 02:44:34 -0500

Procópio gravatar image

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

edit flag offensive delete link more

Question Tools



Asked: 2017-07-12 05:12:48 -0500

Seen: 551 times

Last updated: Jul 17 '17