Go to the documentation of this file.00001
00011 #include <lfd_common/state.h>
00012 #include <ros/ros.h>
00013 #include <time.h>
00014
00015 using namespace std;
00016
00024 int main(int argc, char **argv)
00025 {
00026
00027 ros::init(argc, argv, "mock_state_publisher");
00028
00029 ros::NodeHandle node;
00030
00031
00032 ros::Publisher update_state = node.advertise<lfd_common::state> ("state_listener", 1);
00033
00034
00035 srand(time(NULL));
00036
00037 ROS_INFO("Mock State Publisher Initialized");
00038
00039
00040 while (ros::ok())
00041 {
00042
00043 lfd_common::state s;
00044 for (int i = 0; i < 3; i++)
00045 s .state_vector.push_back(rand() % 25);
00046 update_state.publish(s);
00047 ros::spinOnce();
00048 }
00049
00050 return EXIT_SUCCESS;
00051 }