00001 //ROS typedefs 00002 #include "ros/ros.h" 00003 #include <std_msgs/String.h> 00004 00005 /* protected region user include files on begin */ 00006 /* protected region user include files end */ 00007 00008 class talker_config 00009 { 00010 public: 00011 std::string word; 00012 00013 }; 00014 00015 class talker_data 00016 { 00017 // autogenerated: don't touch this class 00018 public: 00019 //input data 00020 00021 00022 //output data 00023 std_msgs::String out_pub; 00024 00025 00026 }; 00027 00028 class talker_impl 00029 { 00030 /* protected region user member variables on begin */ 00031 int counter; 00032 bool running; 00033 /* protected region user member variables end */ 00034 00035 public: 00036 talker_impl() 00037 { 00038 /* protected region user constructor on begin */ 00039 counter = 0; 00040 running = false; 00041 /* protected region user constructor end */ 00042 } 00043 void configure(talker_config config) 00044 { 00045 /* protected region user configure on begin */ 00046 /* protected region user configure end */ 00047 } 00048 void update(talker_data &data, talker_config config) 00049 { 00050 /* protected region user update on begin */ 00051 if(running == true) 00052 { 00053 counter ++; 00054 std::stringstream ss; 00055 ss << config.word << " : " << counter; 00056 data.out_pub.data = ss.str(); 00057 } 00058 00059 if(counter > 10) 00060 running = false; 00061 /* protected region user update end */ 00062 } 00063 00064 00065 void callback_TriggerPublish_(const bride_tutorials::TriggerPublishGoalConstPtr &goal, actionlib::SimpleActionServer<bride_tutorials::TriggerPublishAction> *as_) 00066 { 00067 /* protected region user implementation of action callback for TriggerPublish on begin */ 00068 counter = 0; 00069 running = true; 00070 while(running == true) 00071 sleep(0.1); 00072 as_->setSucceeded(); 00073 /* protected region user implementation of action callback for TriggerPublish end */ 00074 } 00075 00076 00077 00078 00079 /* protected region user additional functions on begin */ 00080 /* protected region user additional functions end */ 00081 00082 };