Beispiel #1
0
        private void ComputeAngularVelocities(TrajectoryKinematics kinematics, CalibrationHelper calibrationHelper)
        {
            if (kinematics.Length <= 2)
            {
                PadAngularVelocities(kinematics);
                return;
            }

            for (int i = 1; i < kinematics.Length - 1; i++)
            {
                double d1             = GetDisplacementAngle(kinematics, i, i - 1);
                double d2             = GetDisplacementAngle(kinematics, i + 1, i);
                float  time           = calibrationHelper.GetTime(2);
                float  inRadPerSecond = (float)((d1 + d2) / time);

                kinematics.AngularVelocity[i]         = calibrationHelper.ConvertAngularVelocity(inRadPerSecond);
                kinematics.TangentialVelocity[i]      = calibrationHelper.ConvertSpeed((float)(inRadPerSecond * kinematics.RotationRadius));
                kinematics.CentripetalAcceleration[i] = calibrationHelper.ConvertAcceleration((float)(inRadPerSecond * inRadPerSecond * kinematics.RotationRadius));
            }

            PadAngularVelocities(kinematics);
        }
Beispiel #2
0
        private void ComputeVelocity(TimeSeriesCollection tsc, CalibrationHelper calibrationHelper)
        {
            if (tsc.Length <= 2)
            {
                PadVelocities(tsc);
                return;
            }

            for (int i = 1; i < tsc.Length - 1; i++)
            {
                float a1    = positions[i - 1];
                float a2    = positions[i + 1];
                float t     = calibrationHelper.GetTime(2);
                float omega = (a2 - a1) / t;

                velocities[i] = omega;
                tsc[Kinematics.AngularVelocity][i] = (double)calibrationHelper.ConvertAngularVelocity(omega);

                float v = radii[i] * omega;
                tsc[Kinematics.TangentialVelocity][i] = (double)calibrationHelper.ConvertSpeed(v);
            }

            PadVelocities(tsc);
        }