You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found that type(msg) for a message loaded from a rosbag.Bag() does not match the actual type of the message.
For instance, a Float32 message created in a python module has type <class 'std_msgs.msg._Float32.Float32'>, but the same message loaded from a bag file has type <class 'tmpfCH1Bk._std_msgs__Float32'> (notice tmpfCH1Bk).
A problem with this randomly-generated type occurs when pickling the messagess (i.e. rosbag -> pickle). After pickling, one cannot unpickle the messages since the module doesn't exist:
Traceback (most recent call last):
...
File "/usr/lib/python2.7/pickle.py", line 1124, in find_class
__import__(module)
ImportError: No module named tmpfCH1Bk
Note there's on exception: if you pickle and unpickle in the same instance of the interpreter, the temporary module is still defined, but that sortof goes against the point of pickling data to use later :).
I have found that
type(msg)
for a message loaded from a rosbag.Bag() does not match the actual type of the message.For instance, a Float32 message created in a python module has type
<class 'std_msgs.msg._Float32.Float32'>
, but the same message loaded from a bag file has type<class 'tmpfCH1Bk._std_msgs__Float32'>
(notice tmpfCH1Bk).A problem with this randomly-generated type occurs when pickling the messagess (i.e. rosbag -> pickle). After pickling, one cannot unpickle the messages since the module doesn't exist:
Note there's on exception: if you pickle and unpickle in the same instance of the interpreter, the temporary module is still defined, but that sortof goes against the point of pickling data to use later :).
Here is a MWE that reproduces this error.
https://www.dropbox.com/sh/i38kf379gmedsie/AACCe7AmdOjGCKk_aLfJmijYa?dl=0
Once the messages in the bag file get pickled, loading them from another run causes the ImportError described above.
The text was updated successfully, but these errors were encountered: