Go to the documentation of this file.00001
00002
00003 import roslib; roslib.load_manifest( 'rviz_backdrop' )
00004 from sensor_msgs.msg import Image
00005 from sensor_msgs.msg import CompressedImage
00006 import rospy
00007
00008
00009 image_file = 'workshop-short.jpg'
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 pub = rospy.Publisher( '/backdrop/compressed', CompressedImage )
00022
00023 rospy.init_node( 'backdrop_node' )
00024
00025 rate = rospy.Rate(1)
00026
00027 dist = 3
00028
00029 image = CompressedImage()
00030 image.header.frame_id = "/odom_combined"
00031 image.format = "jpeg"
00032 image.data = open( image_file ).read()
00033
00034 while not rospy.is_shutdown():
00035
00036 image.header.stamp = rospy.Time.now()
00037
00038 pub.publish( image )
00039
00040 print "published."
00041 rate.sleep()