.db file format and trajectory (odometry) data from .db file

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

.db file format and trajectory (odometry) data from .db file

You Li
Hi Mathieu,

Is there any information on the format of .db file, then we can extract information from it?
Meanwhile, is there any instruction on extracting the trajectory (i.e., timestamps as well as the device location at each time)?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

You Li
By following the instruction at http://answers.ros.org/question/238705/extract-odometry-and-map-from-db-file-on-tango/
I was able to obtain the trajectory information by using "export poses" in RTAB-Map. Is seems that the RGBD-SLAM format (https://vision.in.tum.de/data/datasets/rgbd-dataset) is the only one that has a timestamp information.

When there is multiple datasets, it is not very convenient to extract the information (e.g., trajectory and point clouds) one by one through the use of the RTAB-Map software. It would be great if there is a command for extracting the data, directly from the terminal.

Thanks!

Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

You Li
With the Tango device, I got a poses information with a data rate of about 1 Hz, is it possible to change the output rate of the pose information?

Cheers,
You Li
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

matlabbe
Administrator
This post was updated on .
Hi,

The poses are recorded as fast as the map update rate, which is 1 Hz by default. There is the Map Update parameter in Mapping options that can be set to update the map faster (up to ~5 Hz on Google Tango Development Kit), but a lot more memory will be used (EDIT: if you only need poses without saving clouds, you can use Trajectory Mode to save memory). If you want to record Tango poses at higher frame rate > 10/50 Hz, you may have to create your own app.

Indeed, there are no command line tools for information extraction. The database format is here, and information can be fetched using sqlite3 directly. Note that saved poses are raw odometry poses, we need to optimize the graph to get the actual optimized poses. For command line tools, you may add an issue on github for future developments.

cheers
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

You Li
Hi Mathieu, thanks a lot for the reply!
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

You Li
In reply to this post by matlabbe
Hi Mathieu,

Thank you for the information. Now I am trying to extract the real-time pose information directly from the source code. It is straightforward to find the position and Euler angle information by using the latest pose in Rtabmap.cpp. However, when I was trying to extract the timestamp information as well, it seems that all the timestamps in Rtabmap.cpp are relative time periods, instead of the absolute timestamps for the whole data processing process. Do you have any suggestion on where could I get the absolute timestamps? It would be great if the timestamps are the same ones to the timestamps in the recorded database.

Thanks,
You Li

Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

matlabbe
Administrator
Hi,

RTAB-Map should export exactly the same stamps saved in database. Tango doesn't use absolute timestamps, but a relative one to ensure time correctness:
The Project Tango tablet uses a different timestamp channel other than the system time to ensure the timestamp correctness.
When exporting poses in RGBD-SLAM format, I get for example:
13048.753206 -0.038558 -0.092011 0.025661 -0.090869 0.941459 -0.323810 0.023348
13049.801750 -0.031318 -0.114297 0.072116 -0.094032 0.920353 -0.378536 0.028605
13050.919995 -0.051859 -0.132593 0.169201 -0.103676 0.861276 -0.493519 0.062395
13052.042406 -0.173208 -0.165432 0.250874 -0.107293 0.799779 -0.584281 0.086362
13053.222018 -0.201293 -0.177311 0.255115 0.019472 0.790771 -0.610603 -0.038278
which I is the number of seconds since the device was initialized (not since 1970).

I didn't find any documentation to convert this relative time to absolute time (epoch). There is an interesting comparison of timestamps here: http://stackoverflow.com/questions/29236110/timing-issues-with-tango-image-frames

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

You Li
HI Mathieu, many thanks for your quick reply! Yes, the RGBD SLAM format outputed the timestamps. May I ask where does the RTABMAP software save the timestamps like "13048.753206, 13049.801750, ....". If I could obtain these timestamps, that would be great. The reason is that I have other sensor data, which need to be sychronized with the SLAM poses. For convenient, I can manually set a set of timestamps to sychronize them. However, this method can simply sychronize the data and the real-time poses, instead of the post-processing one. So by obtaining the time like "13048.753206, 13049.801750, ...." in real-time could perfectly solve my problem.

Thanks,
You Li
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

matlabbe
Administrator
Hi,

They correspond to Tango timestamp of the RGB image, and they are set here (the last parameter "rgbStamp"). I'm currently revising how this stamp is saved, adding it an offset to match roughly current epoch time.

I also edited this post above to mention that you can use Trajectory Mode if you only need the poses to save memory.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

You Li
Hi Mathieu,
Thank you very much for the detailed information and suggestions on trajectory mode, I will look at this.
By the way, why would the trajectory mode save more memory (maybe by using less observations?), does it sacrifices the accuracy of location?

Cheers,
You Li
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

matlabbe
Administrator
Trajectory mode doesn't save RGB/depth data to database, only poses and visual features used for loop closure detection. You won't be able to get a 3D map from that database, but localization/loop closure detection will work exactly the same (e.g., you will get exactly the same optimized poses as in a normal mapping session).

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

You Li
Thanks Mathieu, this is great. Also, I really enjoy your data recorder mode, which can use Tango as simply a data logger, and left the processing task to the station. Another great choice!
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

matlabbe
Administrator
In data recorder mode, loop closure detection is disabled, so you have to think when revisiting same areas to look exactly in the same orientation/position surfaces with discriminative visual features to make sure that when reprocessing offline the database RTAB-Map can actually find these loop closures for map correction.

For example, see in this video how I came back (1:55) to the billboard (a lot of visual features) to find the last loop closure before pausing.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

fangxu622
hi ~~,now i'm using rtabmap v0.18 with lenovo phab2 pro,  how can export tracjectory data from db files..i want etract data for example timestamp and x y z  position..how to do that ,when i using SqliteStudio open db files ,I think Statistics table have x z y position data,right? but the data col in Statistics table is blob types,I can't transform it to strings....So how can export the trajectory data from phab2 pro~~~
Reply | Threaded
Open this post in threaded view
|

Re: .db file format and trajectory (odometry) data from .db file

matlabbe
Administrator
Hi,

The easiest way is to use rtabmap-databaseViewer tool. Then use File->Export poses. As there is no offciial 0.18 binary version released yet for Windows, you can download this one: https://ci.appveyor.com/project/matlabbe/rtabmap/branch/master/artifacts

cheers,
Mathieu