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: android-porting+unsubscr...@googlegroups.com
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 android-porting+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to