sensor_msgs.msg Image type value error. "Not a message data class"
I'm getting a value error when trying to run this code:
front_image_pub = rospy.Publisher('/front_camera/image_raw', Image, queue_size=10)
The precise error is:
Traceback (most recent call last):
File "/home/nrgadmin/catkin_ws/src/vr_ui/src/playback.py", line 80, in <module>
main()
File "/home/nrgadmin/catkin_ws/src/vr_ui/src/playback.py", line 67, in main
front_image_pub = rospy.Publisher('/front_camera/image_raw', Image, queue_size=10)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 842, in __init__
super(Publisher, self).__init__(name, data_class, Registration.PUB)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 144, in __init__
raise ValueError("data_class [%s] is not a message data class"%data_class.__class__.__name__)
ValueError: data_class [type] is not a message data class
So the fun thing about this error, is that when I substitue the Image type with any of the other sensor_msgs.msg types (such as Temperature, CompressedImage, or Joy) I don't have any error at all.
Here's a link to the full code: https://github.com/SouLeo/360_lab_visualization/blob/master/src/playback.py
My package.xml is here: https://github.com/SouLeo/360_lab_visualization/blob/master/package.xml
My CMakeList is here: https://github.com/SouLeo/360_lab_visualization/blob/master/CMakeLists.txt
I'm so sorry for being dumb, but I seriously don't understand why some sensor_msg topics work and then Image doesn't.
Other things I have tried include:
- Clean building my vr_ui package
- verifying my package.xml and cmake list included sensor_msgs.msg dependency