00001 #include "ros/ros.h" 00002 #include <iri_wam_common_msgs/bhand_cmd.h> 00003 #include "iri_fake_recorder.h" 00004 #include <string> 00005 00006 class BhandFakeRecorder : public IRIFakeRecorder<std::string> 00007 { 00008 private: 00009 ros::NodeHandle nh_; 00010 ros::ServiceServer bhand_cmd_server_; 00011 std::string server_uri_; 00012 00013 bool bhand_cmdCallback(iri_wam_common_msgs::bhand_cmd::Request &req, 00014 iri_wam_common_msgs::bhand_cmd::Response &res); 00015 00016 public: 00017 BhandFakeRecorder(const std::string server_uri); 00018 }; 00019 00020 BhandFakeRecorder::BhandFakeRecorder(const std::string server_uri) : 00021 server_uri_(server_uri) 00022 { 00023 bhand_cmd_server_ = nh_.advertiseService(server_uri_, & BhandFakeRecorder::bhand_cmdCallback, this); 00024 } 00025 00026 bool 00027 BhandFakeRecorder::bhand_cmdCallback(iri_wam_common_msgs::bhand_cmd::Request & req, 00028 iri_wam_common_msgs::bhand_cmd::Response &res) 00029 { 00030 msg_recieved_history_.push_back(req.bhandcmd); 00031 00032 return true; 00033 } 00034