introlab / rtabmap

RTAB-Map library and standalone application
https://introlab.github.io/rtabmap
Other
2.85k stars 787 forks source link

Add GPS field to database #226

Closed matlabbe closed 7 years ago

matlabbe commented 7 years ago

Can be useful for outdoor robots and Tango phone for comparison purpose, limit loop closure detection area or to use in map optimization (#188).

Format (inspired from Location android page):

std::vector of 6 doubles?

murmurSK commented 7 years ago

Hi Mathieu, if this isn't dead after all the situation around Tango, it would be nice if the time would be visible e.g. in Debug view. This will be good to identify the poses when the device was on particular point.

matlabbe commented 7 years ago

Thx for the update, I'm supposed to check tomorrow how to add GPS to database (I was on a major update the past weeks).

For the time, you can tap on the screen to show up the status bar. The idea to keep it always visible in Debug view is a good idea, I may let the whole status bar shown in Debug view (so we can also see battery level). Note also that when opening the database in database viewer afterward, we can see the timestamp for each pose.

cheers, Mathieu

murmurSK commented 7 years ago

Thanks for reply. I didn't realize that the absolute timestamps can be viewed in DB viewer. That's half of my problem solved :) However, it would help greatly if these could be exported with poses instead of relative timestamps. The second half is the ability to note the time in field (during scanning). E.g. "now, at 15:25:15, the device is at Point 1 (which coordinates are known)". Of course, I can check the time using e.g. watches, but there could be a sync problem. The ability to note the time, which is subsequently included in database, will help for georeferencing or even accuracy assessment. According to the noted time I could identify the particular pose and relate it to reference coordinates. Therefore, time in the Status bar is not sufficient, seconds are needed for this (with acceptable level of uncertainty for me). So, this is why it would help me greatly if the time information would be shown somehow :) Best regards, Julian Edit: I don't expect RTAB to be able to note the time. I can do it, I just need to see it.

matlabbe commented 7 years ago

Another precision about the timestamp saved in the databases, they are real date/time stamps in EPOCH format. They can be easily converted to human-readable format using online tool like this one. For convenience, I added a tooltip in database viewer so we can see the real date/time like in the screenshot below (we don't see the mouse pointer but it is over the stamp).

untitled

The commit above implements the GPS support in Tango. With "RTAB-Map Tango -> Settings-> Mapping -> Save GPS in database", GPS values are saved while scanning as shown in the screenshot above (last line). The time (up to milliseconds) and GPS are also shown in Debug view. screenshot_20170921-214023

I just tested with Phab2Pro yet, I'll try with Zenfone and yellowstone tomorrow before doing an official release. Being able to export GPS coordinates from database viewer like the pose may be nice to have too.

murmurSK commented 7 years ago

You are a magician :) Looking forward for the update.

matlabbe commented 7 years ago

After one day trying to integrate the GPS into map optimizations (g2o, gtsam), I abandoned the project as it is less trivial than I thought (may try again in the future, other stuff to do right now). I updated the DatabaseViewer to export GPS values in raw format and in KML format that can be easily opened in Google Earth for fast comparison (we can export GPS values but also the optimized poses transformed into GPS values). Here are some screenshots:

ENU orientation option on right-click to get North-East orientation. GPS values are in green (color can be changed in the right-click menu too). Align to GPS option should be also checked under the graph view to align poses in GPS referential. enu_orientation

export_gps

googleearth

As the minor version changed (0.13->0.14), I need to release new RTAB-Map desktop binaries to be compatible with the new RTAB-Map Tango version. When everything will be released, I'll close this issue.

cheers

murmurSK commented 7 years ago

Oh, I didn't expect that you'll go so far. From my point of view, there are some complications with GPS/Tango integration (I mean internal smartphone GPS):

Thanks for your efforts. Julian

matlabbe commented 7 years ago

Not sure what contains GNSS coordinates, but the raw export format for GPS in DatabaseViewer is all data that android can give me: "stamp longitude latitude altitude error bearing". The bearing is actually the compass in the phone.

RTAB-Map Tango has been just rolled out to production. It should appear as an update in some time on play store.

cheers, Mathieu

fangxu622 commented 5 years ago

@matlabbe hi~~now i'm get the pose data(rgbd-slam format) from tango(save as *.db) , like this image

image

,but now~~how can i get the real world scale from pose data? In other words,How many distances(unit:cm/mm/m)between these two points represent?

matlabbe commented 5 years ago

Please in the future open a new issue as this question is not related to this issue. The RGBD-SLAM format is STAMP, X, Y, Z, QX, QY, QZ, QW where X, Y, Z are in meters. The Q# parameters are the quaternion's parameters.