Help with Init Variables Device Orientation
Posted: 04 Aug 2017 03:09
Hi.
I have been trying to use the Init Variables Device Orientation action but I am not getting the expected values.
I have created a test flow that just reports the Pitch and Roll in a screen notification. With the phone face up on the table the reported pitch is about 0 (or 360) but as I rotate the phone leaving the bottom edge on the table the pitch reduces to 275 with the phone is standing upright on its bottom edge. If I continue to rotate so the screen starts to become face down the pitch increases again and when the screen is completely face down pitch is about 360 again. A similar thing happens if I rotate the phone with the leaving the top edge on the table. The pitch starts at 0, increases to 90 when the phone is standing upside down on its top edge and then reduces again to 0 (360) when the screen is completely face down.
I have used the app Droid info to look at the values from the orientation sensor and they are as expected (i.e. 0 when face up on table, -90 when standing on bottom edge, -180 when face down, 90 when standing on top edge)
I really want to be able use the pitch to tell if the phone is nearly upright (e.g. setting in a dock with a slight lean back). Say -40 > Pitch > -60.
I have been trying to use the Init Variables Device Orientation action but I am not getting the expected values.
I have created a test flow that just reports the Pitch and Roll in a screen notification. With the phone face up on the table the reported pitch is about 0 (or 360) but as I rotate the phone leaving the bottom edge on the table the pitch reduces to 275 with the phone is standing upright on its bottom edge. If I continue to rotate so the screen starts to become face down the pitch increases again and when the screen is completely face down pitch is about 360 again. A similar thing happens if I rotate the phone with the leaving the top edge on the table. The pitch starts at 0, increases to 90 when the phone is standing upside down on its top edge and then reduces again to 0 (360) when the screen is completely face down.
I have used the app Droid info to look at the values from the orientation sensor and they are as expected (i.e. 0 when face up on table, -90 when standing on bottom edge, -180 when face down, 90 when standing on top edge)
I really want to be able use the pitch to tell if the phone is nearly upright (e.g. setting in a dock with a slight lean back). Say -40 > Pitch > -60.