26 #include <cob_map_accessibility_analysis/CheckPointAccessibility.h> 27 #include <cob_map_accessibility_analysis/CheckPerimeterAccessibility.h> 28 #include <cob_3d_mapping_msgs/GetApproachPoseForPolygon.h> 30 int main(
int argc,
char** argv)
32 ros::init(argc, argv,
"map_point_accessibility_check_client");
36 std::string points_service_name =
"/map_accessibility_analysis/map_points_accessibility_check";
37 std::string perimeter_service_name =
"/map_accessibility_analysis/map_perimeter_accessibility_check";
38 std::string polygon_service_name =
"/map_accessibility_analysis/map_polygon_accessibility_check";
42 ROS_INFO(
"Waiting for service server to become available...");
48 if (serviceAvailable ==
false)
50 ROS_ERROR(
"The services could not be found.");
53 ROS_INFO(
"The service servers are advertised.");
56 cob_map_accessibility_analysis::CheckPointAccessibility::Request req_points;
57 cob_map_accessibility_analysis::CheckPointAccessibility::Response res_points;
59 geometry_msgs::Pose2D point;
62 req_points.points_to_check.push_back(point);
65 req_points.points_to_check.push_back(point);
73 ROS_INFO(
"Points request successful, results: ");
74 for (
unsigned int i = 0; i < res_points.accessibility_flags.size(); ++i)
75 ROS_INFO(
" - (xy)=(%f, %f), accessible=%d",
76 req_points.points_to_check[i].x,
77 req_points.points_to_check[i].y,
78 res_points.accessibility_flags[i]);
81 ROS_WARN(
"The service call for points was not successful.");
84 cob_map_accessibility_analysis::CheckPerimeterAccessibility::Request req_perimeter;
85 cob_map_accessibility_analysis::CheckPerimeterAccessibility::Response res_perimeter;
87 req_perimeter.center.x = 2.5;
88 req_perimeter.center.y = 0.5;
89 req_perimeter.center.theta = 0.;
90 req_perimeter.radius = 1.0;
91 req_perimeter.rotational_sampling_step = 10. / 180. * M_PI;
99 ROS_INFO(
"Accessible points on perimeter:");
100 for (
unsigned int i = 0; i < res_perimeter.accessible_poses_on_perimeter.size(); ++i)
102 res_perimeter.accessible_poses_on_perimeter[i].x,
103 res_perimeter.accessible_poses_on_perimeter[i].y,
104 res_perimeter.accessible_poses_on_perimeter[i].theta);
107 ROS_WARN(
"The service call for perimeter points was not successful.");
bool call(const std::string &service_name, MReq &req, MRes &res)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
int main(int argc, char **argv)
ROSCPP_DECL bool waitForService(const std::string &service_name, int32_t timeout)