-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Can't convert Images from a rosbag #2
Comments
I've run into this, too. Appears to be a rosbag issue, not a
|
Based on the answer by rarmstrong22. For anyone searching for a quick working solution. In case you are sure it is a ROS Image message but it still throws this error. import ros_numpy
import sensor_msgs
def get_img_from_ros_image_msg(msg):
""" Returns image as a numpy array.
Note: can be used with any topic of message type 'sensor_msgs/Image'
"""
msg.__class__ = sensor_msgs.msg.Image
return ros_numpy.numpify(msg)
img_array = get_img_from_ros_image_msg(msg) |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
If reading messages from a rosbag one gets an error like:
That's because
From a rosbag the messages don't seem to have the proper type (I guess it has something to do with the way messages are stored).
The text was updated successfully, but these errors were encountered: