00001 00002 #include <ros/ros.h> 00003 #include <coverage_3d_srvs/CleanSpot.h> 00004 #include <cstdlib> 00005 #include <geometry_msgs/Point.h> 00006 00007 int main(int argc, char **argv) { 00008 ros::init(argc, argv, "test_clean_spot"); 00009 00010 ros::NodeHandle n; 00011 ros::ServiceClient client = n.serviceClient<coverage_3d_srvs::CleanSpot>( 00012 "/tidyup/clean_spot"); 00013 00014 coverage_3d_srvs::CleanSpot srv; 00015 00016 srv.request.spot.header.frame_id = "/base_link"; 00017 srv.request.spot.point.x = 0.6; 00018 srv.request.spot.point.y = 0.0; 00019 srv.request.spot.point.z = 0.65; 00020 srv.request.box_size = 0.1; 00021 if (client.call(srv)) { 00022 ROS_INFO_STREAM("Call Successful"); 00023 return 0; 00024 } else { 00025 ROS_ERROR_STREAM("Service call failed " << client.getService()); 00026 return 1; 00027 } 00028 00029 return 0; 00030 }