URI:
   DIR Return Create A Forum - Home
       ---------------------------------------------------------
       Mobile AR Framework Support Forum
  HTML https://mobilear.createaforum.com
       ---------------------------------------------------------
       *****************************************************
   DIR Return to: Outdoor AR Library
       *****************************************************
       #Post#: 28--------------------------------------------------
       Adding OrientationFilter
   DIR By: ganymede
       Date: April 15, 2013, 9:24 am
       ---------------------------------------------------------
       Hi,
       I would like to add a filter to the OASensorManager that sets
       some orientation parameters to fixed values. So, I created the
       following class:
       --- Code ---
       
       public class OrientationFilterDisabler implements
       OrientationFilter<OrientationFilterDisabler> {
       @Override
       public Quaternion filterOrientationValues(Quaternion arg0) {
       arg0.setY(90.0f);
       return arg0;
       }
       }
       
       --- End Code ---
       Taking the SampleOAComponent Example from the tutorial, I added
       --- Code ---
       
       getSensorManager().addInertialFilter(new
       OrientationFilterDisabler());
       --- End Code ---
       to the onCreate method of SampleARComponent.
       Nothing happened and I figured out that a breakpoint in my
       filterOrientationValues method is never executed.
       Am I missing something?
       Cheers
       ganymede
       #Post#: 29--------------------------------------------------
       Re: Adding OrientationFilter
   DIR By: hitlabnz
       Date: April 15, 2013, 5:19 pm
       ---------------------------------------------------------
       Hi ganymede,
       It seems to be a bug.
       To fix it temporarily, you can modify the addInertialFilter
       method of the OASensorManager class in the library as the
       following:
       public void addInertialFilter(OrientationFilter<?> filter){
       inertialManager.addOrientationFilter(filter);
       inertialManager.filterAcceleromter(true); // add this line
       }
       Also, FYI, please be minded that the filter is using quaternion,
       not Euler angles.
       #Post#: 30--------------------------------------------------
       Re: Adding OrientationFilter
   DIR By: ganymede
       Date: April 16, 2013, 8:26 am
       ---------------------------------------------------------
       Ok, that works for me. Thank you!
       *****************************************************
       Page 1 of 1