Hi,

Just an update.  I have calibrated the accelerometer so that when I do dumpsys 
sensorservice it shows pretty much the same readings as my Samsung S3 when 
it's flat on a table, standing upright, on its side, etc, etc.

Screen rotate will *not* work though.  It just flips 90 degrees once after 
booting, and that's it.  That might be an indication that screen rotation 
is alive but getting bad readings?

Any suggestions?  Thanks so much!
Andrew


On Wednesday, April 16, 2014 6:50:47 PM UTC+8, Andrew Jones wrote:
>
> Hi everyone,
>
> I'm suffering from the exact same problem as the OP.  I ported the MMA7660 
> accelerometer into the sensors HAL for Android 4.3.
> If I do a dumpsys sensorservice my readings look reasonable:
>
> Sensor List:
> Freescale 3-axis Accelerometer                  | Freescale Semiconductor 
> Inc.     | 0x00000000 | maxRate=  50.00Hz | last=< -1.7, 16.7,  1.1>
> CM3232 Light sensor                             | Capella                 
>          | 0x00000004 | maxRate=2000.00Hz | last=<  0.0,  0.0,  0.0>
> 9-axis fusion disabled (0 clients), gyro-rate=   0.00Hz, q=< 0, 0, 0, 0 > 
> (0), b=< 0, 0, 0 >
> 2 h/w sensors:
> handle=0x00000000, active-count=0, rates(ms)={  }, selected=200.0 ms
> handle=0x00000004, active-count=0, rates(ms)={  }, selected= 0.0 ms
> 0 active connections
> Active sensors:
>
> But If I use any app for showing the accelerometer readings, none of them 
> work.  They just show all zeros.
> Any suggestions, any at all, would be appreciated so much!
>
> Thankyou!
> Andrew
>
>
> On Friday, June 14, 2013 9:19:16 PM UTC+8, ffxx68 wrote:
>>
>> Nothing was really missing, apart from "calibration". 
>>
>> Since parameters for low-pass filtering (to extract gravity; hardcoded in 
>> AOSP in *WindowOrientationListener.java*) are based on real m/s^2 
>> acceleration values, having sensor returning values too far from reality 
>> made some check functions reject rotations. I had to add my conversion, 
>> with these changes in HAL:
>>
>>  
>> https://github.com/Renesas-EMEV2/Renesas-device_emev/commit/7cb1a28f4baa0cb744f1124aecade3477da87c67
>>
>> Indeed, after fixing calibration, rotation is correctly propagated when I 
>> rotate device. This is for example what I get when tabelt is front.facing, 
>> in portrait orientation:
>>
>> V/WindowOrientationListener(  258): Raw acceleration vector: x=-7.967903, 
>> y=1.2258313, z=5.5162406, magnitude=9.768268
>> V/WindowOrientationListener(  258): Filtered acceleration vector: 
>> x=-7.772365, y=1.587711, z=5.426243, magnitude=9.611171
>> V/WindowOrientationListener(  258): Predicted: tiltAngle=34, 
>> orientationAngle=282, predictedRotation=3, predictedRotationAgeMS=349.939
>> V/WindowOrientationListener(  258): Result: currentRotation=0, 
>> proposedRotation=3, predictedRotation=3, timeDeltaMS=139.97, 
>> isAccelerating=false, isFlat=false, isSwinging=false, 
>> timeUntilSettledMS=0.0, timeUntilAccelerationDelayExpiredMS=0.0, 
>> timeUntilFlatDelayExpiredMS=0.0, timeUntilSwingDelayExpiredMS=0.0
>>
>> Note the magnitute of about 9.8 m/s^2, which is closer to real "g", than 
>> without calibration. Magnitute was around 16 before and I was getting a lot 
>> of "proposedRotation=-1".
>>
>> NOTE - Home launcher screen is never re-oriented. Not sure why... But 
>> other screens (e.g. Systems Settings, do get re-oriented).
>>
>> On Wednesday, 29 May 2013 06:30:54 UTC+2, 마재경 wrote:
>>>
>>> Hi, 
>>>
>>>
>>> I'm a beginner android user, I ported accelerometer sensor named 
>>> "BMA250E" and Board don't use MPU, MPL.
>>>
>>>
>>> Only use accelerometer. On the kernel, sensor act well. when i 
>>> programmed HAL code. and library file(XXX.so)
>>>
>>>
>>> was downloaded on the target board. But, sensor was not recognized in 
>>> app layer.
>>>
>>>
>>> Should i more programmed for using it?
>>>
>>>
>>> Please give me some advice about that.
>>>
>>>
>>> Best Regards.
>>>
>>

-- 
-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to