00001 #ifndef RFNSERVER_RFNSERVER_H_ 00002 #define RFNSERVER_RFNSERVER_H_ 00003 00004 #include <ros/ros.h> 00005 #include <actionlib/server/simple_action_server.h> 00006 #include <std_msgs/String.h> 00007 #include <boost/filesystem.hpp> 00008 #include <roboframenet_msgs/FilledSemanticFrameAction.h> 00009 #include <roboframenet_msgs/AddFrame.h> 00010 #include <roboframenet_msgs/AddLexicalUnit.h> 00011 #include <roboframenet_msgs/RegisterWithFrame.h> 00012 00013 namespace rfnserver { 00014 00015 class RFNServer : public actionlib::SimpleActionServer<roboframenet_msgs::FilledSemanticFrameAction> { 00016 00017 public: 00018 typedef boost::function<void (const roboframenet_msgs::FilledSemanticFrame)> FSFCallback; 00019 RFNServer(ros::NodeHandle nh, std::string callback_topic, FSFCallback fsf_callback); 00020 00021 bool add_frame(std::string filepath); 00022 bool add_lexical_unit(std::string filepath); 00023 bool register_with_frame(std::string frame_name); 00024 00025 static std::string frame_argument(roboframenet_msgs::FilledSemanticFrame frame, std::string parameter_name); 00026 00027 protected: 00028 00029 00030 private: 00031 ros::NodeHandle nh_; 00032 std::string callback_topic_; 00033 FSFCallback fsf_callback_; 00034 void executeCB(const roboframenet_msgs::FilledSemanticFrameGoalConstPtr &goal); 00035 }; 00036 }; 00037 00038 00039 #include <rfnserver/rfnserver_imp.h> 00040 #endif