[whatwg] Orientation event in Firefox

Dave Burke daveburke at google.com
Wed Sep 2 14:26:15 PDT 2009


On Mon, Aug 31, 2009 at 11:06 PM, Doug Turner <doug.turner at gmail.com> wrote:

> Thanks Dave for your comments.
> I was thinking about update frequency.  right now, it is up to the UA (we
> are using 50ms).
>

To give an explicit example, if you want to run a high pass (say to detect
only sudden movements), you might code a simple k-order FIR filter of the
form:

   y[n] = b0.x[n] + b1.x[n-1] + ... +  bk.x[n-k]

The coefficient values b0 ... bk are a function of the sampling rate
("update frequency") and hence needs to be settable or at least known to
allow code portability.


> units -- yes.  in g.  This is best.
>
> magnetometer -- but in a different API, right?  I do not see directly how
> you would combined the two.
>

It's a different API, but (can be) closely related. You can present
magnetometer information either as x, y, z of the magnetic field vector or
as the special case of compass orientation. For example, Android has the
same SensorEvent<http://developer.android.com/reference/android/hardware/SensorEvent.html>for
both Sensor.TYPE_ACCELEROMETER and Sensor.TYPE_MAGNETIC_FIELD. Lots of
interesting use-cases for compass ranging from map tile orientation,
navigation, augmented reality, etc.


> Also see: http://dougt.org/wordpress/2009/08/orientation-update/ for some
> demos.
>
> Doug
>
> On Aug 31, 2009, at 2:54 PM, Dave Burke wrote:
>
> +1, I like this approach for its simplicity and familiarity.
>
> As part of fleshing out, there are probably a few small but key additions
> that would greatly increase effectiveness:
>   - update frequency (knowing the sample rate is crucial for even the most
> trivial DSP operations such as filtering)
>   - units (convention is in units of 'g', i.e 9.81 m/s^2)
>   - magnetometer in addition to accelerometer (for heading)
>
> Dave
>
> On Mon, Aug 24, 2009 at 4:39 AM, Doug Turner <doug.turner at gmail.com>wrote:
>
>> I posted some thoughts and a strawman for orientation in Firefox:
>>
>> http://dougt.org/wordpress/2009/08/orientation/
>>
>> Regards,
>> Doug Turner
>>
>>
>>
>>
>>
>
>
> --
>
> Sent from Wandsworth, Greater London, United Kingdom
>
>
>


-- 

Sent from Zurich, Switzerland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090902/49369769/attachment-0002.htm>


More information about the whatwg mailing list