41 import sensor_msgs.msg
42 from cv_bridge
import CvBridge
50 self.
pub = rospy.Publisher(topic, sensor_msgs.msg.Image)
51 self.
pub_compressed = rospy.Publisher(topic +
"/compressed", sensor_msgs.msg.CompressedImage)
57 while not rospy.core.is_shutdown():
59 self.
pub.publish(cvb.cv2_to_imgmsg(cvim))
66 s =
Source(args[1], args[2:])
67 rospy.init_node(
'Source')
71 outcome =
'test completed'
72 except KeyboardInterrupt:
73 print(
"shutting down")
74 outcome =
'keyboard interrupt'
75 rospy.core.signal_shutdown(outcome)
77 if __name__ ==
'__main__':