Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
* linux-iio and Windows default orientations
@ 2020-05-12 13:55 Bastien Nocera
  2020-05-12 16:12 ` Hans de Goede
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien Nocera @ 2020-05-12 13:55 UTC (permalink / raw)
  To: linux-iio; +Cc: Hans de Goede

Hey,

I'm just dotting the is, and crossing the ts on a bunch of iio-sensor-
proxy documentation and wanted to revisit the IIO documentation,
compared to what Windows, and my implementation did.

Does this:
https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/Documentation/ABI/testing/sysfs-bus-iio#n1638
in particular the "Z" axis:
"Z is perpendicular to the screen plane and positive out of the screen"

match this:
https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/sensor-orientation
"with the positive z-axis extending out from the device."

This Microsoft page didn't exist when I changed the code to "match
Windows 10" in 2016:
https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/commit/35b6328cbdaa5efa30917c445962d64fd733fb02

(And just to double check, it seems that the other 2 axis do match in
their definitions, right?)

Cheers


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-iio and Windows default orientations
  2020-05-12 13:55 linux-iio and Windows default orientations Bastien Nocera
@ 2020-05-12 16:12 ` Hans de Goede
  2020-06-24  9:31   ` Bastien Nocera
  0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2020-05-12 16:12 UTC (permalink / raw)
  To: Bastien Nocera, linux-iio

Hi,

On 5/12/20 3:55 PM, Bastien Nocera wrote:
> Hey,
> 
> I'm just dotting the is, and crossing the ts on a bunch of iio-sensor-
> proxy documentation and wanted to revisit the IIO documentation,
> compared to what Windows, and my implementation did.
> 
> Does this:
> https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/Documentation/ABI/testing/sysfs-bus-iio#n1638
> in particular the "Z" axis:
> "Z is perpendicular to the screen plane and positive out of the screen"
> 
> match this:
> https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/sensor-orientation
> "with the positive z-axis extending out from the device."

Yes I believe that the 2 are stating the same, this is also how the
Z axis works on Android I believe. If you put a phone or tablet
flat on a table with the display up, then you will get a -1.0G or -9.8 m/s²
reading since the gravity is pulling downwards (away from the front of
the screen) with 1G.

> This Microsoft page didn't exist when I changed the code to "match
> Windows 10" in 2016:
> https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/commit/35b6328cbdaa5efa30917c445962d64fd733fb02
> 
> (And just to double check, it seems that the other 2 axis do match in
> their definitions, right?)

Yes I believe they do, and also again Android's definition.

Regards,

Hans


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: linux-iio and Windows default orientations
  2020-05-12 16:12 ` Hans de Goede
@ 2020-06-24  9:31   ` Bastien Nocera
  0 siblings, 0 replies; 3+ messages in thread
From: Bastien Nocera @ 2020-06-24  9:31 UTC (permalink / raw)
  To: Hans de Goede, linux-iio

On Tue, 2020-05-12 at 18:12 +0200, Hans de Goede wrote:
> Hi,
> 
> On 5/12/20 3:55 PM, Bastien Nocera wrote:
> > Hey,
> > 
> > I'm just dotting the is, and crossing the ts on a bunch of iio-sensor-
> > proxy documentation and wanted to revisit the IIO documentation,
> > compared to what Windows, and my implementation did.
> > 
> > Does this:
> > https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/tree/Documentation/ABI/testing/sysfs-bus-iio#n1638
> > in particular the "Z" axis:
> > "Z is perpendicular to the screen plane and positive out of the screen"
> > 
> > match this:
> > https://docs.microsoft.com/en-us/windows/uwp/devices-sensors/sensor-orientation
> > "with the positive z-axis extending out from the device."
> 
> Yes I believe that the 2 are stating the same, this is also how the
> Z axis works on Android I believe. If you put a phone or tablet
> flat on a table with the display up, then you will get a -1.0G or
> -9.8 m/s²
> reading since the gravity is pulling downwards (away from the front
> of
> the screen) with 1G.

"extending out from the device" could mean away from the user, so away
from the display, which would invert the Z axis compared to the IIO
docs. I think that's the opposite of what was actually meant, but just
to make doubly sure, I filed a bug against the Windows docs:
https://github.com/MicrosoftDocs/windows-uwp/issues/2542

> > This Microsoft page didn't exist when I changed the code to "match
> > Windows 10" in 2016:
> > https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/-/commit/35b6328cbdaa5efa30917c445962d64fd733fb02
> > 
> > (And just to double check, it seems that the other 2 axis do match in
> > their definitions, right?)
> 
> Yes I believe they do, and also again Android's definition.

This seems to match indeed:
https://developer.android.com/reference/android/hardware/SensorEvent


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 13:55 linux-iio and Windows default orientations Bastien Nocera
2020-05-12 16:12 ` Hans de Goede
2020-06-24  9:31   ` Bastien Nocera

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git