Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid - accelerometer on motodroid 1 reports incorrect values at first?
    primarykey
    data
    text
    <p>So I'm writing an app that detects movement, and needs to be calibrated to various movements. Over the past few days, I've noticed that right after a <code>SensorEventListener</code> is registered, <code>onSensorChanged(SensorEvent)</code> throws out incomplete (and therefore erroneous) <code>.values[]</code>. This behavior screws up my calibration process, and the amount of force that signifies a movement is way too high. I have verified that this is the case for every accelerometer logging app I have downloaded and tested, so its not an error specific to my code. I think this might be caused by bad hardware (possibly specific to my moto droid 1), or a software bug by the custom ROM I'm using (Simply Stunning 4.9, from Froyo 2.2.1 source.)</p> <p>Example:</p> <pre><code>sensorManager.registerListener(this, sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SENSOR_DELAY); .... onSensorChanged(SensorEvent event){ // event.values[0] = 0.0 // event.values[1] = -0.47 // event.values[2] = 0.0 } .... onSensorChanged(SensorEvent event){ // event.values[0] = 0.08 // event.values[1] = -0.47 // event.values[2] = 0.0 } .... onSensorChanged(SensorEvent event){ // event.values[0] = 0.08 // event.values[1] = -0.47 // event.values[2] = 10.1 } </code></pre> <p>As you can see, it often takes 2 readings before all of the correct values are accessible.</p> <p>Can anyone confirm or deny this behavior on the moto droid 1 or other phone? Do you think a good solution is to just drop the first 2 or 3 readings so that they don't warp my calibration?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload