I'm making an app (a collaboration), and for this, we're using a camera with an overlay on top of it. We're hoping to use this so that the user(s) can only take a photo when it's at a specific angle. Unfortunately, I'm not sure how to get the angle.
The idea goes like this:
The user calibrates the device on a flat surface using a Button.
The overlay will point in the direction of where the phone should be tilted, and a capture Button will be enabled when the phone is titled at an angle between -1.5° and +1.5° of the target values (these will be read from a list).
I've tried reading the documentation for the GyroscopeSensor and the Accelerometer, but I couldn't exactly understand how I could use this in the app. For this reason, I'm reaching out to the amazing folks present on this Community.
Ouch, I forgot the OrientationSensor even existed.
I've read the documentation, but couldn't find anything about calibrating it. Is there a method to do this? Or is it calibrated automatically on initialization?