Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Take a look at this rosservice tutorial.

  ros::NodeHandle n;
  ros::ServiceClient client = n.serviceClient<std_srvs::Empty>("/move_base_node/clear_costmaps");
  std_srvs::Empty srv;
  if (client.call(srv))
  {
    ROS_INFO("Success!");
  }
  else
  {
    ROS_ERROR("Failed to call service move_base_node/clear_costmaps");
    return 1;
  }