Skip to content

Commit

Permalink
Implemented fix for converting messaged from rosbags from eric-wieser#6
Browse files Browse the repository at this point in the history
  • Loading branch information
iv461 committed Nov 12, 2022
1 parent 4a43efd commit 9bf7c2d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ros_numpy/src/ros_numpy/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ def numpify(msg, *args, **kwargs):


if not conv:
raise ValueError("Unable to convert message {} - only supports {}".format(
msg.__class__.__name__,
', '.join(cls.__name__ + ("[]" if pl else '') for cls, pl in _to_numpy.keys())
))
for class_instance, _ in _to_numpy.keys():
if msg._type == class_instance._type:
if msg._md5sum == class_instance._md5sum:
conv = _to_numpy.get((class_instance, False))
break
else:
raise ValueError("Unable to convert message {} - only supports {}".format(
msg.__class__.__name__,
', '.join(cls.__name__ + ("[]" if pl else '') for cls, pl in _to_numpy.keys())
))

return conv(msg, *args, **kwargs)

Expand Down

0 comments on commit 9bf7c2d

Please sign in to comment.