Created
April 26, 2015 12:14
-
-
Save marjinal1st/d8a4d31777ec3ddad643 to your computer and use it in GitHub Desktop.
ROS Camera Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import rospy | |
import cv2 | |
from sensor_msgs.msg import Image | |
from cv_bridge import * | |
def callback(msg): | |
bridge = CvBridge() | |
image = bridge.imgmsg_to_cv2(msg, "bgr8") | |
cv2.imshow("test", image) | |
cv2.waitKey(1) | |
def main(): | |
rospy.init_node("camera_test") | |
camera = rospy.Subscriber("/rrbot/camera1/image_raw", | |
Image, | |
callback, | |
queue_size=10) | |
rospy.spin() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment