When i try to echo the topics of a bag file, i get a message : data: !!binary | ChQJpiM5J7b11UESB2dhdGV3YXkYSRI7GAEt0YmNPjUAAAAARQAAAABNAAAAAF0AAAAAqAEAsAEA uAEAygEUCaYjOSe29dVBEgdjaGFzc2lzGAcamgEKGwl+jANaaLcaQRG3Y7kbwu1QQRlNc4QFq/qd vxIkCQAAAAAAAAAAEQAAAAAAAAAAGbZX/zsVBNw/IYPT7lNnxew/GhsJlaAsEDqx0T8R+pqtiJCs kzwZBQSdL5XVZj8iGwmW/f98qKacPxHERbyH1aKhvBlzAOArHy9+vyobCfeLggMmjbI8ER2XZG1t Jzg/GfBTn4g5Yn08IQAAAAAAABxA
This data seems to be binary encoded. The message type of this topic is string
. How can i read this data ?
Originally posted by aks on ROS Answers with karma: 667 on 2018-05-15
Post score: 0
Original comments
Comment by PeteBlackerThe3rd on 2018-05-15:
Can you show us the command you are using to try and echo the topics of a bag file. This doesn't look like anything I've seen from rostopic echo
before.
Comment by aks on 2018-05-16:
The command is normal rostopic echo /pnc/carstatus
but there seems to be a unicode error. It also says : UnicodeDecodeError: 'ascii' codec cant decode byte 0xe7 in position 1496: ordinal not in range(128)
.
Comment by gvdhoorn on 2018-05-16:
This is most likely a std_msgs/String
that either:
- contains multibyte characters
- is being abused for transmitting non-character data
It would help if you could show the message definition @aakash_sehgal.
Comment by aks on 2018-05-16:
@gvdhoorn could you kindly guide me how to do that ? I only have the rosbag file.
Comment by aks on 2018-05-16:
ran the python script from the command line : ./ message_definition.py Bagname
but it gives the same error : UnicodeDecodeError: 'ascii' codec cant decode byte 0xe7 in position 1496: ordinal not in range(128)
. Exactly this
Comment by gvdhoorn on 2018-05-16:
Yes, that's a problem. I don't have time to look into this right now, but it's one of the consequences of most some of ROS Python code not being Unicode aware/safe.
What you could do is open the bag file with a text editor (don't save it), then scroll down a bit until you ..
Comment by gvdhoorn on 2018-05-16:
.. come across message definitions.
If you know a bit of text from the definition that would help, as you can then just search for it.
Then carefully copy-paste the def into a new file and save it as a msg def.
Comment by gvdhoorn on 2018-05-16:
I seem to remember you got this bag / these bags from a colleague. If that is the case, it would be infinitely easier / more convenient to just get the definitions from him.