ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

It looks like you have a name collision between your class named Image and the message type you are importing as Image.

Can you try importing the Image message with a different name? e.g.

from sensor_msgs.msg import Image as ImageMsg

And use ImageMsg to create your publisher

front_image_pub = rospy.Publisher('/front_camera/image_raw', ImageMsg, queue_size=10)

It looks like you have a name collision between your class named Image and the message type you are importing as Image.

Can you try importing the Image message with a different name? e.g.

from sensor_msgs.msg import Image as ImageMsg

And use ImageMsg to create your publisher

front_image_pub = rospy.Publisher('/front_camera/image_raw', ImageMsg, queue_size=10)

Alternative: Or you can try renaming your Image class to something like MyImage