![]() |
2010-11-12
, 00:52
|
Posts: 724 |
Thanked: 1,255 times |
Joined on Nov 2007
@ Cambridge, UK
|
#2
|
![]() |
2010-11-12
, 01:00
|
Posts: 104 |
Thanked: 46 times |
Joined on Sep 2010
@ New York City
|
#3
|
Hi!
Not sure if this is a bug relating to Qt mobility or Maemo 5
With reading sensor values through mobility and values through "/sys/class/i2c-adapter/i2c-3/3-001d/coord" I've found the Y and Z values to be inverse (apart from other things). Lying the phone face up, it gives me
Through Qt Mobility: 0.35, 0.35, 9.5
through reading file: 36, -36, -954
Would this be a maemo bug since according to this page, face up should give a positive z value (http://doc.qt.nokia.com/qtmobility-1.0/sensors-api.html).
Additionally why are the values all have different ranges. Qt Mobility on the simulator has -50 to +50, on maemo -10 to +10 while reading the values from that file gives -1000 to +1000. Would other phone models behave similarly (eg would the N8 or N9 have the same ranges as maemo or closer to the simulator)?
I've attached the project i used to test it.
![]() |
2010-11-12
, 01:03
|
Posts: 724 |
Thanked: 1,255 times |
Joined on Nov 2007
@ Cambridge, UK
|
#4
|
![]() |
2010-11-12
, 01:04
|
|
Posts: 397 |
Thanked: 802 times |
Joined on Jan 2010
@ Sydney
|
#5
|
![]() |
2010-11-12
, 01:07
|
Posts: 724 |
Thanked: 1,255 times |
Joined on Nov 2007
@ Cambridge, UK
|
#6
|
Makes sense. I just would have assumed it would try to make it more uniform across platforms to ease in development. Guess to port to another platform you'd have to change the maths slightly.
I guess it also answers why the values are inverse, as Qt would probably try to make all phones face up have positive Z values no matter how their accelerometer is placed inside.
thanks
![]() |
2010-11-12
, 01:11
|
|
Posts: 397 |
Thanked: 802 times |
Joined on Jan 2010
@ Sydney
|
#7
|
Well, this is the whole reason of Qt Mobility Sensors API, it means you don't have to worry about talking to the hardware directly and can write code once that will work the same on all platforms/devices.
![]() |
2010-11-12
, 01:13
|
Posts: 724 |
Thanked: 1,255 times |
Joined on Nov 2007
@ Cambridge, UK
|
#8
|
So it might still be a bug, only if other devices behave differently.
Also I guess the simulator would need to have the limits changed.
![]() |
2010-11-12
, 01:20
|
|
Posts: 397 |
Thanked: 802 times |
Joined on Jan 2010
@ Sydney
|
#9
|
Not sure if this is a bug relating to Qt mobility or Maemo 5
With reading sensor values through mobility and values through "/sys/class/i2c-adapter/i2c-3/3-001d/coord" I've found the Y and Z values to be inverse (apart from other things). Lying the phone face up, it gives me
Through Qt Mobility: 0.35, 0.35, 9.5
through reading file: 36, -36, -954
Would this be a maemo bug since according to this page, face up should give a positive z value (http://doc.qt.nokia.com/qtmobility-1.0/sensors-api.html).
Additionally why are the values all have different ranges. Qt Mobility on the simulator has -50 to +50, on maemo -10 to +10 while reading the values from that file gives -1000 to +1000. Would other phone models behave similarly (eg would the N8 or N9 have the same ranges as maemo or closer to the simulator)?
I've attached the project i used to test it.
Last edited by Blaizzen; 2010-11-12 at 00:45.