Hello.

Sorry for the delay. Got sick in between.
Thanks for taking the time to review this.

On 08/12/2013 05:14 PM, Thomas Daede wrote:
On Thu, Aug 1, 2013 at 3:39 AM, Stefan Schmidt <s.schm...@samsung.com>
wrote:

+    <event name="motion">
+      <description summary="Motion event coming from the compass
sensor">
+       Updated sensor data available from compass
+      </description>
+      <arg name="x" type="fixed" summary="x-axis"/>
+      <arg name="y" type="fixed" summary="y-axis"/>
+      <arg name="z" type="fixed" summary="z-axis"/>
+    </event>

These events don't have any units, and there isn't any particular
information about the sensor passed either. Is this supposed to be
read out of band? Presuming the motion integration happens in the
client. it's very important for a coordinate system to be defined
between the accelerometer, gyroscope, and compass, and information
like sensor bandwidth is also important.

I added units as well as a coordinate system description now. Please see the attachment for the current version and let me know if that covers it. Going to send it out next week and would be happy about more feedback. :)

Sensors that combine all three of the above with an integral IMU
processor are also becoming more and more common - that's at least one
more type that we will need. I definitely think the interface should
be designed - the abstraction has to be somewhere, and I'd prefer it

Did you miss to finish the sentence? My parser fails on it. :)

here rather than every client accessing the devices directly - but I
want to make sure that this is possible with all sorts of devices in
the future.

What exactly are you missing? I started small here on purpose. But based on some real needs this can be extended. Nothing set in stone.

There a number of other devices that I'd like to see implemented in
this manner - for example, 3D mice. In this case, unlike the motion
sensors, window focus does matter.

What would you propose to handle these?

regards
Stefan Schmidt

>From 77b19aeff0b1c65625a4aa3b41821c61afa9ea6e Mon Sep 17 00:00:00 2001
From: Stefan Schmidt <s.schm...@samsung.com>
Date: Tue, 9 Jul 2013 15:36:41 +0100
Subject: [PATCH] protocol: Extend wayland seat with interfaces for sensor
 inputs.

Treating some specific sensors as input devices. In particular
adding support for wl_compass, wl_gyroscope and wl_accelerometer here.

Using these sensor as input for apps and games. Not covering any
background apps or services with this protocol.

We have requests to start and stop sensor event receiving as well as
events to receive the different axis values for these sensors.

V2:
o Add units to event arguments
o Define coordinate system

Signed-off-by: Stefan Schmidt <s.schm...@samsung.com>
---
 protocol/wayland.xml |  142 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 142 insertions(+)

diff --git a/protocol/wayland.xml b/protocol/wayland.xml
index d7bbbb9..ee295a1 100644
--- a/protocol/wayland.xml
+++ b/protocol/wayland.xml
@@ -1251,6 +1251,9 @@
       <entry name="pointer" value="1" summary="The seat has pointer devices"/>
       <entry name="keyboard" value="2" summary="The seat has one or more keyboards"/>
       <entry name="touch" value="4" summary="The seat has touch devices"/>
+      <entry name="compass" value="8" summary="The seat has compass devices"/>
+      <entry name="gyroscope" value="16" summary="The seat has gyroscope devices"/>
+      <entry name="accelerometer" value="32" summary="The seat has accelerometer devices"/>
     </enum>
 
     <event name="capabilities">
@@ -1297,6 +1300,39 @@
 
     <!-- Version 2 of additions -->
 
+    <request name="get_compass" since="2">
+      <description summary="return compass object">
+        The ID provided will be initialized to the wl_compass interface
+	for this seat.
+
+        This request only takes effect if the seat has the compass
+        capability.
+      </description>
+      <arg name="id" type="new_id" interface="wl_compass"/>
+    </request>
+
+    <request name="get_gyroscope" since="2">
+      <description summary="return gyroscope object">
+        The ID provided will be initialized to the wl_gyroscope interface
+	for this seat.
+
+        This request only takes effect if the seat has the gyroscope
+        capability.
+      </description>
+      <arg name="id" type="new_id" interface="wl_gyroscope"/>
+    </request>
+
+    <request name="get_accelerometer" since="2">
+      <description summary="return accelerometer object">
+        The ID provided will be initialized to the wl_accelerometer interface
+	for this seat.
+
+        This request only takes effect if the seat has the accelerometer
+        capability.
+      </description>
+      <arg name="id" type="new_id" interface="wl_accelerometer"/>
+    </request>
+
     <event name="name" since="2">
       <description summary="unique identifier for this seat">
 	In a multiseat configuration this can be used by the client to help
@@ -1605,6 +1641,112 @@
     </event>
   </interface>
 
+  <interface name="wl_compass" version="2">
+    <description summary="compass sensor device">
+      The wl_compass interface represents a compass
+      associated with a seat.
+    </description>
+
+    <request name="start">
+      <description summary="Start receiving events">
+	Sent to enable event receiving for the compass sensor.
+      </description>
+    </request>
+
+    <request name="stop">
+      <description summary="Stop receiving events">
+	Sent to disable event receiving for the compass sensor.
+      </description>
+    </request>
+
+    <event name="motion">
+      <description summary="Motion event coming from the compass sensor">
+	Updated sensor data available from compass
+
+	Measurement of the ambient magnetic field in the X, Y and Z axis.
+
+	Coordinate system (device in portrait mode with screen facing upwards):
+	X axis goes from the left to the right side of the device
+	Y axis goes from the bottom of the screen to the top
+	Z axis goes from the back of the screen to the front of the screen
+     </description>
+      <arg name="x" type="fixed" summary="x-axis in micro Tesla (uT)"/>
+      <arg name="y" type="fixed" summary="y-axis in micro Tesla (uT)"/>
+      <arg name="z" type="fixed" summary="z-axis in micro Tesla (uT)"/>
+    </event>
+  </interface>
+
+  <interface name="wl_gyroscope" version="2">
+    <description summary="gyroscope sensor device">
+      The wl_gyroscope interface represents a gyroscope
+      associated with a seat.
+    </description>
+
+    <request name="start">
+      <description summary="Start receiving events">
+	Sent to enable event receiving for the gyroscope sensor.
+      </description>
+    </request>
+
+    <request name="stop">
+      <description summary="Stop receiving events">
+	Sent to disable event receiving for the gyroscope sensor.
+      </description>
+    </request>
+
+    <event name="motion">
+      <description summary="Motion event coming from the gyroscope sensor">
+	Updated sensor data available from gyroscope
+
+	Measurement of the rate of rotation around X, Y and Z axis in degree per second.
+	Values are observed in positive notation in the counter-clockwise direction.
+
+	Coordinate system (device in portrait mode with screen facing upwards):
+	X axis goes from the left to the right side of the device (Pitch)
+	Y axis goes from the bottom of the screen to the top (Roll)
+	Z axis goes from the back of the screen to the front of the screen (Azimuth/Yaw)
+      </description>
+      <arg name="x" type="fixed" summary="x-axis in degree per second"/>
+      <arg name="y" type="fixed" summary="y-axis in degree per second"/>
+      <arg name="z" type="fixed" summary="z-axis in degree per second"/>
+    </event>
+  </interface>
+
+  <interface name="wl_accelerometer" version="2">
+    <description summary="accelerometer sensor device">
+      The wl_accelerometer interface represents a accelerometer
+      associated with a seat.
+    </description>
+
+    <request name="start">
+      <description summary="Start receiving events">
+	Sent to enable event receiving for the accelerometer sensor.
+      </description>
+    </request>
+
+    <request name="stop">
+      <description summary="Stop receiving events">
+	Sent to disable event receiving for the accelerometer sensor.
+      </description>
+    </request>
+
+    <event name="motion">
+      <description summary="Motion event coming from the accelerometer sensor">
+	Updated sensor data available from accelerometer
+
+	Measurement of the acceleration of G on the axis in m/s^2.
+
+	Coordinate system (device in portrait mode with screen facing upwards):
+	X axis goes from the left to the right side of the device
+	Y axis goes from the bottom of the screen to the top
+	Z axis goes from the back of the screen to the front of the screen
+      </description>
+      <arg name="x" type="fixed" summary="x-axis G in m/s^2"/>
+      <arg name="y" type="fixed" summary="y-axis G in m/s^2"/>
+      <arg name="z" type="fixed" summary="z-axis G in m/s^2"/>
+    </event>
+  </interface>
+
   <interface name="wl_output" version="2">
     <description summary="compositor output region">
       An output describes part of the compositor geometry.  The
-- 
1.7.9.5

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to