New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the timestamp format in PBStream #856
Comments
A co-worker has pointed me in the right direction. The Protobuf documentation shows how the timestamp is formed. The timestamps are relative to 0001-01-01T00:00:00Z rather than the Unix epoch. The units are 1/10000000 seconds. |
Use |
@mjseabright Hi, I want to extract data from pbstream. How do you extract trajectory from pbstream? I look forward to your reply. |
@woshidaye I used this code. It is a little outdated now as I had to change all references of sparse_pose_graph to pose_graph. It may require more changes to be compatible with the latest version of Cartographer. |
@mjseabright Is the code running through the 'python export_pose_graph.py example.pbstream' command? Why prompt error: 'ImportError: No module named cartographer.mapping' when running? |
@woshidaye Yes, that is how you run it. It looks like you need to run the commands at the top of that script to generate the required python protobuf descriptor files.
The files this generates describe the pbstream format and how to interpret it. Copy the generated files (they will be in the py_export folder) to wherever you are running the export_pose_graph.py script from. That should solve the error you are getting. |
@mjseabright I follow your steps, but there are still errors. When 'python export_pose_graph.py example.pbstream' is entered at the terminal, it still prompts errors 'ImportError: No module named cartographer.mapping'. |
Try it with python3. |
@mjseabright When I ran according to your command, a new error occurred : |
It's saying you're missing the google module that it is trying to get the protobuf module from. |
@mjseabright Thank you for your answer. However, there was another error: Looking forward to your reply again. Thank you. |
@woshidaye Could you solve the last error? |
@woshidaye @fsblu The
You can get past it by putting in a leading underscore like this:
You'll have to rename the associated folders and change it everywhere this happens. You'll also have to change references to Having done that, I'm still not sure it works correctly, though. When I try to run it on a test file I get:
If anyone can shed some light on this, I would appreciate it. |
@TSRyan
at the end you can write the whole list or just the parts you need to a file. |
Thanks, @Bitfroest. That will get me where I need to go. |
In addition to my previous post you can use the following code snipped to get the PoseGraph as dict
Source: https://stackoverflow.com/questions/19734617/protobuf-to-json-in-python In case someone else wants to convert the times here is my way.
Here the python conversion with using the combined information.
Source: https://stackoverflow.com/questions/1832714/18-digit-timestamp |
MessageToDict is a great tool. I assume |
Hi, I've managed to pull the trajectory out of a PBStream file but I cannot work out what the timestamps mean.
Exampe:
timestamp: 636533061005937350 pose { translation { x: 1.8459875994728516 y: -4.098475079319226 } rotation { z: -0.999340312949446 w: 0.036317198599333245 } } node_index: 1251
I would have thought the timestamps would corresponded to times in the bag file. So the example above would be somewhere around 1517709302.83 or Feb 04 2018 14:55:02.83.
I noticed a similar timestamp in #460 so I don't think it's that I'm decoding it incorrectly.
What does this timestamp mean? What time does it correspond to?
Thank you very much for any insight you can provide.
The text was updated successfully, but these errors were encountered: