ar-localizer-view-android icon indicating copy to clipboard operation
ar-localizer-view-android copied to clipboard

How to speak the distance of a place when you're pointing to it

Open masilv4 opened this issue 5 years ago • 2 comments

Hello, guys. I'm so glad that I've found this great library cause I'm in a project which uses AR and I have to add an accessibility feature for people with visual impairments. At the beginning, I'd like to make the app speaks (using TextToSpeech) the distance of a place when the user points to it. Is it possible? And if it is, how can I achieve that?

masilv4 avatar Feb 27 '20 05:02 masilv4

You want the app to speak when user is clicking the label? You can try to implement override fun onTouchEvent(event: MotionEvent?): Boolean in ArLabelView and check the coordinates of the touch with coordinates of a specific label and then handle the distance from the label in some text to speech logic (https://android-developers.googleblog.com/2009/09/introduction-to-text-to-speech-in.html) that you would also have to implement yourself. There are many ways in which you can achieve this. Unfortunately the library itself doesn't handle that specific case, it's only for displaying the destination labels with the distance.

gabrysgab avatar Mar 02 '20 11:03 gabrysgab

Hi, gabrysgab.

No. I want the app speaks the distance of the label which is in the center of the screen when the user long click the screen. I know that in some cases two or more labels will be overlapping each other but I will handle this by speaking the distance of the most close to the current location.

I'm currently trying to implement a means of when the user long clicks the screen one function will be called to verify if the device's current azimuth is equal (not exactly, but in a range of 5 degrees) to some place's azimuth. If it is, the app will speak the distance of that place.

val currentDestinationAzimuth = (headingAngle - currentAzimuth + 360) % 360

When currentDestinationAzimuth is in the range of (-5, 5) degrees it means that I'm pointing to a place. I will do a for loop verifying this with all the places around, whenever occur a long click event.

I'm using the Krzysztof Jackowski's article as basis. See here: https://www.netguru.com/blog/augmented-reality-mobile-android

What do you think? Any suggestions?

masilv4 avatar Mar 03 '20 20:03 masilv4