publish_screenpoint.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # http://www.ros.org/wiki/ROS/Tutorials/WritingPublisherSubscriber%28python%29
00004 import roslib; roslib.load_manifest('opencv_ros_bridge_tutorial')
00005 import rospy;
00006 import math;
00007 from geometry_msgs.msg import PointStamped
00008 
00009 pub = rospy.Publisher('/image_painted/screenpoint', PointStamped)
00010 rospy.init_node('publish_screenpoint')
00011 msg = PointStamped()
00012 i = 0;
00013 while not rospy.is_shutdown():
00014     msg.header.stamp = rospy.Time.now()
00015     msg.point.x = 320 + 180*math.sin(i)
00016     msg.point.y = 240 + 180*math.cos(i)
00017     i += 0.1
00018     print msg;
00019     pub.publish(msg)
00020     rospy.sleep(0.1)
00021 
00022 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


opencv_ros_bridge_tutorial
Author(s): Kei Okada
autogenerated on Thu Jun 27 2013 14:58:43