Python pickling with ros msgs
Hello Community, I am transmitting custom ros msgs through a ZeroMQ protocol over a network. In order to create a data stream that I can send, I use the pickle method within Python. It works perfectly when I pass and receive over localhost. However when it is unicasted to a remote machine I am unable to load it back using pickle.loads(message). I get the following error:
ImportError: No module named genpy.rostime
This is really puzzling me since I believe genpy is a part of roslib and I have imported roslib. I also imported other necessary modules like pickle, rospy etc. Has anyone used pickle to package and parse ros msgs ? I would appreciate any help or suggestions. Thank you, Ammar
EDIT: So I was experimenting with a bunch of different serialization methods to broadcast a custon ros msg over a network. However all of them give the error 'No module name genpy.rostime' during deserialization... The most recent method I am using is: initializing a ros msg using socket.send_pyobj() on the other machine: socket.recv_pyobj() --> This is where it errors out because it cannot find genpy.rostime
I am absolutely sure it is nothing with ZeroMQ (my communication protocol) since it can deserialize other python objects perfectly. Could some one please help me figure out how to deserialize ros msg objects in Python? I am completely lost
Serious question: why? Why are you using fully three different serialization tools? Can you explain the problem you're trying to solve?