introlab / rtabmap

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

Phab2 Pro Tango: coordinates seem backwards #143

Closed matlabbe closed 7 years ago

matlabbe commented 7 years ago

"coordinates on the Phab2 seem backwards and it isn't working"

Rafcin commented 7 years ago

@matlabbe Yep

matlabbe commented 7 years ago

Unfortunately, I don't have a Phab2 Pro to test with (I added this issue from a comment I received). The problem may be a wrong transformation when converting Tango pose to RTAB-Map coordinate system, e.g., this one is depending on the hardware (cameras/IMU position).

If someone can map with a Phab2 Pro (like moving 2-3 meters forward), then save the database and send it here I could investigate more the problem.

cheers, Mathieu

cavercse commented 7 years ago

Hi, I just specifically signed up to try to help get RTAB-Map working on the Lenovo Phab2 Pro. Here's a database of me walking forward and turning left 180 degrees. Hopefully this helps. If not than let me know what you need. WalkFowardandTurnLeft.zip

matlabbe commented 7 years ago

Thx, it helped a lot to find a problem with the depth registration to color camera. The projected point cloud looks good but the textures are upside down (in reality it is the depth image that is upside down, top center view): untitled

I also did a cleanup of the transforms used, according to Tango, OpenGL and RTAB-Map different referentials. The new version will be officially released on the Play Store in a couple of minutes (I'll post a new comment when it is released).

matlabbe commented 7 years ago

The update is now online. You should know that you have the latest version if in the "Mapping Options..." menu there is a "HD Mode" option instead of "720p Mode" option.

matlabbe commented 7 years ago

If there is something wrong, capturing another similar database would be great. thx!

cavercse commented 7 years ago

Sweet! Thanks! I just tried it out and it works good as far as the rendering/mapping goes now. The biggest issue I can see now is that the first and third person screen viewing orientation is still off 90 degrees though. The X and Y axis and grid needs to be rotated 90 degrees counter clockwise with respect to the screen if that makes any sense. I've attached a video that will probably show the issue better than I can explain it.

Also, I just tried the "HD Mode" and it crashes the program. The "720p Mode" did the same thing in the past.

Google Tango Lenovo.zip

matlabbe commented 7 years ago

The movements look ok in the application, but the app should be in landscape mode. That makes sense as the Phab 2 Pro is a phone (so it is in Portrait mode by default), not a tablet like the Google Tango development kit.

It seems to be an option in the app's manifest.xml:

android:screenOrientation="landscape"

I'll play with it on my tablet to see if I can reproduce the same bug by forcing my tablet to be in Portrait mode.

EDIT: This line: https://github.com/introlab/rtabmap/blob/f6cca3313a1acd6b19e862797ce3741aa834b8d7/app/android/AndroidManifest.xml.in#L29

matlabbe commented 7 years ago

New version with this fix is in prod, should be available through update in a moment.

cavercse commented 7 years ago

Now that you point it out, the auto-rotate on the phone seems to be stuck in portrait mode for almost everything. That's got to be an issue with the phone or android os. I'll let you know how the RTAB-Map update works once I try it out.

matlabbe commented 7 years ago

From the Android documentation for the android:screenOrientation tag, I think it is more app-dependent as in the manifest we can ignore the phone orientation "nosensor" so that it will be always in the same mode (portrait or landscape). Setting to "fullSensor" or "sensor" would flip between portrait and landscape.

cavercse commented 7 years ago

It seems to be working good now. I'll keep using it and see if there are another issues that I can find.

matlabbe commented 7 years ago

Thank you for your feedback! I'll close this issue. Note that I just opened an issue for the HD Mode issue.

cheers, Mathieu