• Found the fix to gotcha 1

    Recall that glitch1 produces Pitch values that fluctuate for a steady position of the IMU chip.
    The BNO055.js has been changed to fix this problem and the median filter has been removed from the 3dMouse8aDrain.js.
    The original approach was to read a series of BNO055 registers in one big scoop.

    BNO055.prototype.getIMU=function(){
     var IMU=new Int16Array(13);
     this.selectPage(0);
     IMU=this.ReadBytes(this.Page0Regs.EUL_HeĀ­ading_LSB,26);
     this.Head[0]=IMU[0]/this.EULscale;
     this.Head[1]=IMU[1]/this.EULscale;
     this.Head[2]=IMU[2]/this.EULscale;
     this.Quant[0]=IMU[3]/2;
     this.Quant[1]=IMU[4]/2;
     this.Quant[2]=IMU[5]/2;
     this.Quant[3]=IMU[6]/2;
     this.Lin[0]=IMU[7]/this.ACCscale;
     this.Lin[1]=IMU[8]/this.ACCscale;
     this.Lin[2]=IMU[9]/this.ACCscale;
     this.Grav[0]=IMU[10]/this.ACCscale;
     this.Grav[1]=IMU[11]/this.ACCscale;
     this.Grav[2]=IMU[12]/this.ACCscale;
    };//end getIMU
    

    By changing the way the data are read from the BNO055 the data value flutter issue has been resolved.
    (The Art of Computer Programming)

    BNO055.prototype.getIMU=function(){
     var IMU=[];
     this.selectPage(0);
     var R=this.Page0Regs.EUL_Heading_LSB;
     for(var i=0;i<13;i++){
      IMU.push(this.ReadBytes(R,2));
      R=R+2;
     }//next i
     this.Head[0]=IMU[0]/this.EULscale;
     this.Head[1]=IMU[1]/this.EULscale;
     this.Head[2]=IMU[2]/this.EULscale;
     this.Quant[0]=IMU[3]/2;
     this.Quant[1]=IMU[4]/2;
     this.Quant[2]=IMU[5]/2;
     this.Quant[3]=IMU[6]/2;
     this.Lin[0]=IMU[7]/this.ACCscale;
     this.Lin[1]=IMU[8]/this.ACCscale;
     this.Lin[2]=IMU[9]/this.ACCscale;
     this.Grav[0]=IMU[10]/this.ACCscale;
     this.Grav[1]=IMU[11]/this.ACCscale;
     this.Grav[2]=IMU[12]/this.ACCscale;
    };//end getIMU
    
    

    The module will be further updated to extend this discovery to other block reads of data.


    2 Attachments

About