6 from sensor_msgs.msg
import Image
8 from cv_bridge
import CvBridge, CvBridgeError
11 cmd =
"ls /dev/video* > vs.out" 13 vf = open(
'vs.out',
'r') 20 cmd =
"udevadm info "+vd+
" |grep 'ID_VENDOR_ID=0bda' > vs.info" 22 infof = open(
"vs.info",
'r') 23 info = infof.readlines() 34 if __name__ ==
'__main__':
35 rospy.init_node(
'camera_image')
36 pub = rospy.Publisher(
'/xbot/camera/image', Image, queue_size=5)
39 rospy.loginfo(
"Not find face camera")
41 capture = cv2.VideoCapture(index)
42 cv_bridge = CvBridge()
44 while not rospy.is_shutdown():
45 ret, frame = capture.read()
46 frame = cv2.flip(frame,1)
47 msg = cv_bridge.cv2_to_imgmsg(frame,
"bgr8")