Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include <iostream>
00030 #include <boost/bind.hpp>
00031 #include <boost/thread.hpp>
00032 #include <boost/foreach.hpp>
00033 #include <boost/assign/std/vector.hpp>
00034
00035 #include <ros/ros.h>
00036 #include <std_msgs/String.h>
00037
00038 using namespace std;
00039 using namespace boost::assign;
00040
00041 #define foreach BOOST_FOREACH
00042
00043
00044 int main(int argc, char **argv) {
00045 ros::init(argc, argv, "fsm_turstile_events");
00046
00047 ros::NodeHandle node;
00048 ros::Publisher eventPublisher = node.advertise<std_msgs::String>("/decision_making/fsm_turnstile/events", 1, false);
00049
00050 int currentEvent = 0;
00051 vector<string> events;
00052 events += "COIN","COIN","PUSH","PUSH";
00053
00054 ROS_INFO("Starting turnstile event publisher...");
00055
00056 while (ros::ok()) {
00057 std_msgs::String event;
00058 event.data = events[currentEvent++];
00059 currentEvent %= events.size();
00060
00061 eventPublisher.publish(event);
00062 boost::this_thread::sleep(boost::posix_time::seconds(1));
00063 }
00064 return 0;
00065 }