dobbst01 / android-augment-reality-framework

Automatically exported from code.google.com/p/android-augment-reality-framework
GNU General Public License v3.0
0 stars 0 forks source link

Its slower than mixare #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Its based on mixare but objects on camera screen are moving way more slowly 
than mixare's. Can it be fixed? 

Original issue reported on code.google.com by Cagkan0C...@gmail.com on 16 Jan 2012 at 11:39

GoogleCodeExporter commented 8 years ago
It seems much faster at rendering on my phone. I am doing some additional 
filtering to smooth the compass data, you can turn that off and see if it helps.

In the class LowPassFilter there is an ALPHA variable. If you make that value 
closer to 1 it should do less smoothing.

You could also trying not using the smoothing at all, in class SensorsActivity:
Change:
        if (evt.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
            smooth = LowPassFilter.filter(evt.values, grav);
            grav[0] = smooth[0];
            grav[1] = smooth[1];
            grav[2] = smooth[2];
        } else if (evt.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {
            smooth = LowPassFilter.filter(evt.values, mag);
            mag[0] = smooth[0];
            mag[1] = smooth[1];
            mag[2] = smooth[2];
        }
To:
        if (evt.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
            //smooth = LowPassFilter.filter(evt.values, grav);
            grav[0] = evt[0];
            grav[1] = evt[1];
            grav[2] = evt[2];
        } else if (evt.sensor.getType() == Sensor.TYPE_MAGNETIC_FIELD) {
            //smooth = LowPassFilter.filter(evt.values, mag);
            mag[0] = evt[0];
            mag[1] = evt[1];
            mag[2] = evt[2];
        }

Original comment by phishman3579@gmail.com on 17 Jan 2012 at 11:18

GoogleCodeExporter commented 8 years ago

Original comment by phishman3579@gmail.com on 17 Jan 2012 at 11:19

GoogleCodeExporter commented 8 years ago
You can also try disabling collision detection:

In class AugmentedReality, set the variable useCollisionDetection to false.

Original comment by phishman3579@gmail.com on 17 Jan 2012 at 11:26

GoogleCodeExporter commented 8 years ago
They didn't work quite but changing this line

sensorMgr.registerListener(this, sensorGrav, SensorManager.SENSOR_DELAY_NORMAL);
sensorMgr.registerListener(this, sensorMag, SensorManager.SENSOR_DELAY_NORMAL);

to

sensorMgr.registerListener(this, sensorGrav, SensorManager.SENSOR_DELAY_UI);
sensorMgr.registerListener(this, sensorMag, SensorManager.SENSOR_DELAY_UI);

worked. 
Thanks for this project by the way, its really cool.

Original comment by Cagkan0C...@gmail.com on 21 Jan 2012 at 7:32

GoogleCodeExporter commented 8 years ago
Yea, That's another good option to speed things up. I am guessing I don't see 
the same problems because my processor is a bit quicker.

Original comment by phishman3579@gmail.com on 21 Jan 2012 at 9:10