place_matcher_hist_server.cpp
Go to the documentation of this file.
00001 /********************************************
00002  * Server for polygon dissimilarity based on histograms.
00003  *
00004  *************************************/
00005 
00006 #include <ros/ros.h>
00007 
00008 #include <place_matcher_msgs/GetCapability.h>
00009 
00010 #include <place_matcher_hist/dissimilarity_getter.h>
00011 
00012 bool callback_getCapability(place_matcher_msgs::GetCapabilityRequest& req, place_matcher_msgs::GetCapabilityResponse& res)
00013 {
00014   res.scale_invariance = place_matcher_msgs::GetCapabilityResponse::IRRELEVANT;
00015   res.translation_invariance = place_matcher_msgs::GetCapabilityResponse::IRRELEVANT;
00016   res.rotation_invariance = place_matcher_msgs::GetCapabilityResponse::IRRELEVANT;
00017   res.provides_dissimilarity = false;
00018   res.provides_pose = true;
00019   return true;
00020 }
00021 
00022 int main(int argc, char **argv)
00023 {
00024   int max_thread;
00025   ros::init(argc, argv, "polygon_dissimilarity_server_hist");
00026   ros::NodeHandle nh("~");
00027 
00028   nh.param<int>("max_thread", max_thread, 1);
00029 
00030   place_matcher_hist::DissimilarityGetter dissimilarity_getter(nh);
00031 
00032   ros::ServiceServer get_capability_server = nh.advertiseService("get_capability", callback_getCapability);
00033   ros::ServiceServer compute_dissimilarity_server = nh.advertiseService("compute_dissimilarity",
00034       &place_matcher_hist::DissimilarityGetter::getDissimilarity, &dissimilarity_getter);
00035 
00036   ROS_INFO("Ready to work (with %i threads)", max_thread);
00037 
00038   ros::MultiThreadedSpinner spinner(max_thread);
00039   spinner.spin();
00040 
00041   return 0;
00042 }
00043 
00044 


place_matcher_hist
Author(s):
autogenerated on Sat Jun 8 2019 19:53:03