Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compass heading from deviceorientation
Message
From
25/04/2014 08:49:27
 
 
To
25/04/2014 08:43:06
General information
Forum:
HTML5
Category:
Browser issues
Miscellaneous
Thread ID:
01598938
Message ID:
01599059
Views:
29
>Results vary a lot with only minor changes to any of the input values:
result: 7.046408425590759alpha:2.4603574070439738 beta: 0.6170228812798457 gamma: -0.10332701324789607
>>>>result: 346.38209648523616alpha:2.4529665255733537 beta: 0.7445035661819629 gamma: 0.14693780311807225
>>>>result: 323.7233478510366alpha:2.4845233810017673 beta: 0.833801293904539 gamma: 0.5579781136510195 
>>>>result: 329.008299842608alpha:2.4764343283698595 beta: 0.8381191267246367 gamma: 0.4553249133004684 
>>>>result: 334.725548494047alpha:2.4684135113669075 beta: 0.8278849276394666 gamma: 0.348097048499672
>>>>result: 340.71391817968237alpha:2.461853051087034 beta: 0.8186382448641772 gamma: 0.2475292789778855 
>>>>result: 347.15633074038885alpha:2.4561540103590627 beta: 0.8008004917341757 gamma: 0.14678892798674084 
>>>>result: 354.4269473034584alpha:2.451044891296479 beta: 0.7906537474295814 gamma: 0.04312349358490233 
>>>>result: 1.7843130240315808alpha:2.4428582726856356 beta: 0.7780242913386914 gamma: -0.05750370999075051 
>>>>result: 9.100154926831845alpha:2.4387029626060905 beta: 0.775427620358397 gamma: -0.1583050342919901 
>>>>result: 359.885344715594alpha:2.4628581134963703 beta: 0.6254340599609843 gamma: -0.025646558918639244 
>>>>result: 4.523793658145151alpha:2.596318259831484 beta: 0.5869759139752974 gamma: -0.07331963792916502 
>>>>result: 5.763368012442853alpha:2.596818384656943 beta: 0.7196717736453192 gamma: -0.10575804385912449 
>>>>result: 12.11694797364695alpha:2.6004789464347144 beta: 0.7852986395008963 gamma: -0.20626720572883836 
>>>>result: 5.5265596587107835alpha:2.604506988938409 beta: 0.7266541171534491 gamma: -0.10381731352376557
>>>>result: 14.73266921491841alpha:2.602183666809788 beta: 0.7347126347609391 gamma: -0.22932036683207827 
>>>
>>>> Haven't dug into it yet....
>>>>
>>>
>>>Update - I was wrong - I forgot the signs of the gamma values
>>
>>OK. I updated the relevant gamma values, ran the C# version and a javascript version using the same data. The results were identical but still skip around more than is warranted :-{
>
>
>If you only convert the alpha to degrees - what about that ?
>
>140.96809551737
>140.544629202222
>142.352703832975
>141.889235256908
>141.429676294392
>141.053789608692
>140.727258627706
>140.43452766839
>139.965468973505
>139.727387243379
>141.111375442894
>148.758078561094
>148.786733602823
>148.996468343336
>149.227258178497
>149.094141626078
>
>
>http://w3c.github.io/deviceorientation/spec-source-orientation.html
>
>A device lying flat on a horizontal surface with the top of the screen pointing West has the following orientation:
>      {alpha: 90,
>       beta: 0,
>       gamma: 0};
>
>
>You may have to subtract 90 if the north is zero degrees

That's what I was doing originally - wasn't too bad but I was hoping that compensating for the beta and gamma would improve things. I've re-instated averaging the last five readings.

I think the remaining problem is caused by trying to process too many events and relying on angular's digest to update values. I'm going to try passing the values directly to the arrow drawing function instead.

I'll let you know how it goes :-}
Previous
Reply
Map
View

Click here to load this message in the networking platform