finger_tip_publisher_node.cpp
Go to the documentation of this file.
00001 #include "ros/ros.h"
00002 #include "std_msgs/String.h"
00003 #include "icr/finger_tips.h"
00004 
00005 #include <sstream>
00006 
00007 
00008 int main(int argc, char **argv)
00009 {
00010 
00011   ros::init(argc, argv, "talker");
00012 
00013   ros::NodeHandle n;
00014 
00015   ros::Publisher chatter_pub = n.advertise<icr::finger_tips>("/finger_tips", 1000);
00016 
00017   ros::Rate loop_rate(10);
00018 
00019 
00020   int count = 0;
00021   while (ros::ok())
00022   {
00023     std::vector<uint8_t> contact(5,1);
00024     std::vector<geometry_msgs::Point> points;
00025     for (uint i=0; i<5;i++) {
00026       geometry_msgs::Point a;
00027       a.x = rand()*100;
00028       a.y = rand()*100;
00029       a.z = rand()*100;
00030       points.push_back(a);
00031     }
00032     icr::finger_tips msg;
00033     msg.in_contact = contact;
00034     msg.points = points;
00035 
00036     chatter_pub.publish(msg);
00037 
00038     ros::spinOnce();
00039 
00040     loop_rate.sleep();
00041     ++count;
00042   }
00043 
00044 
00045   return 0;
00046 }


icr
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:36:10