Ask Your Question

Revision history [back]

MORSE + ROS: which topic do I use for VideoCamera and CV_Bridge?

Hey guys!

I am trying to open a window and see the image from Morse Simulator VideoCamera by using OpenCV.

With the code below I only got a blank window, which freezes after some seconds.

 #!/usr/bin/env python
 import rospy
 from sensor_msgs.msg import Image
 import cv2, cv_bridge

 class Follower:

    def __init__(self):
       self.bridge = cv_bridge.CvBridge()
       cv2.namedWindow("window", 1)
       self.image_sub = rospy.Subscriber('/ATVR/camera/image', Image, self.image_callback)

   def image_callback(self, msg):
        image = self.bridge.imgmsg_to_cv2(msg)
        cv2.imshow("window", image)
 follower = Follower()

Checking rostopic list, I noticed that the camera topic is not being recognized as sensor_msgs/Image, but appear as unknown like /ATVR/camera/image [unknown type].

I dont know if t is the problem source, however I have tried a lot of possible topic combinations and all of them as below and all returned as unknown topic type.

  • /ATVR/camera/image [unknown type]
  • /camera/image_raw [unknown type]
  • /camera/rgb/image_raw [unknown type]
  • /camera/image [unknown type] /camera [unknown type]

Someone could help me?