コード例 #1
0
        private void OnIdealSensorNewTData(object sender, VirtualSensorData e)
        {
            //derivation and store into buffer
            AccelerationTime t = new AccelerationTime();

            t.setVal(e.accelerations, e.NowInTicks);
        }
コード例 #2
0
        private void MyFunctionToDealWithGettingData(object sender, InertialSensorData e)
        {
            const double angularConst = Math.PI / (16.4 * 180);
            //getting acceleration data from sensors
            double xAcc = (double)e.accelaromaters[0] / 2080;
            double yAcc = (double)e.accelaromaters[1] / 2080;
            double zAcc = (double)e.accelaromaters[2] / 2080;

            double xRot = (double)e.gyropscopes[0] * angularConst;
            double yRot = (double)e.gyropscopes[1] * angularConst;
            double zRot = (double)e.gyropscopes[2] * angularConst;

            double[]         tempAngularActualAcc = new double[] { xRot, yRot, zRot };
            double[]         tempActualAcc        = new double[] { xAcc, yAcc, zAcc };
            AccelerationTime tempActualAccTime    = new AccelerationTime();

            tempActualAccTime.setVal(tempActualAcc, tempAngularActualAcc, e.NowInTicks);

            actualAcc.Enqueue(tempActualAccTime);
        }