Skip to content

Can not subscribe to camera topics via Python/Cpp Node #47

@bi3ri

Description

@bi3ri

Hey,

I am not able to subscribe to the camera topics via C++/Python nodes. Visualization in Rviz and RQT works though.

I wrote a small demo program:

import rospy
from sensor_msgs.msg import Image as msg_Image

def callback(data):
    print("hello")
    
def listener():
    rospy.init_node('listener')
    depth_image_topic = 'camera/color/image_raw'
    sub = rospy.Subscriber(depth_image_topic, msg_Image, callback)

    rospy.spin()

if __name__ == '__main__':
    listener()

And although I can see a video stream for the topic camera/color/image_raw in RVIZ and RQT, the callback function is never called, so "hello" is never printed.

If I use the Kinect plugin everything is fine and the callback function is called and "hello" is printed many times.

Did someone had the same problem or a hint, where I could take a look?

Cheers,
Johannes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions