CariusLars / ar_flutter_plugin

Flutter Plugin for AR (Augmented Reality) - Supports ARKit on iOS and ARCore on Android devices
MIT License
318 stars 229 forks source link

Add support to calculate distance between device and anchor and distance between two anchors #115

Closed dnkoulouris closed 2 years ago

dnkoulouris commented 2 years ago

This pull request implements two functionalities that are required for many use cases:

The distance is counted in meters and uses the Vector 3 square root method.
Method getCameraPose() that obtains device coordinates is required and was cloned from gps branch

Methods added in ar_session_manager.dart along with the required platform code in Swift and Kotlin:

Petroni commented 2 years ago

Tested out getDistanceFromAnchor and getDistanceBetweenAnchors on iOS and all seems to be working well without any issues. Currently in the process of testing on Android

CariusLars commented 2 years ago

Hey @dnkoulouris , thanks for the contribution! I left a few comments on your code but looks good otherwise, once @Petroni is done testing on Android and the comments are fixed I'm happy to merge :)

Petroni commented 2 years ago

2 Small issues on the Android side. AndroidARView.kt f line 108 & 116 are throwing errors due to being passing null values. Managed to fix this from my end by passing an empty string instead of null.

dnkoulouris commented 2 years ago

So, what is the current status?

dnkoulouris commented 2 years ago

I also fixed the error that @Petroni mentioned in my fork

CariusLars commented 2 years ago

Hey folks, sorry for the late reply, I've been very busy the last couple of weeks..

@dnkoulouris thanks for the fix, could you reply to / fix the three review comments I left after your initial PR above? After that I´m happy to merge :)

dnkoulouris commented 2 years ago

@CariusLars I can not see your commits. In which branch/repo are they?

CariusLars commented 2 years ago

if you scroll up on this page you should see three review comments (they are not commits). I'v attached a screenshot below

image
dnkoulouris commented 2 years ago

Readme file reverted to the original state.
Concerning the Info.plist issue, according to this: https://github.com/flutter/flutter/issues/94508 I added the flag to support higher frame rates in iPhone screens (iPhone 13 series).

dnkoulouris commented 2 years ago

I also made a commit that fixes this issue. In this commit I included required dependency upgrades.

CariusLars commented 2 years ago

awesome, thanks @dnkoulouris! I merged this just now :)