Example #1
0
        /// <summary>
        /// Create an exponential smoothing joint with default configuration values.
        /// </summary>
        /// <param name="jointType">The joint type to create</param>
        public ExponentialJoint(JointType jointType)
            : base(jointType)
        {
            var parms = new ExponentialSmoothingParameters();

            _smoothing = parms.Smoothing;
            _correction = parms.Correction;
            _prediction = parms.Prediction;
            _jitterRadius = parms.JitterRadius;
            _maxDeviationRadius = parms.MaxDeviationRadius;
            _history = new FilterDoubleExponentialData();
        }
Example #2
0
        /// <summary>
        /// Create an exponential smoothing joint with default configuration values.
        /// </summary>
        /// <param name="jointType">The joint type to create</param>
        public ExponentialJoint(JointType jointType)
            : base(jointType)
        {
            var parms = new ExponentialSmoothingParameters();

            _smoothing          = parms.Smoothing;
            _correction         = parms.Correction;
            _prediction         = parms.Prediction;
            _jitterRadius       = parms.JitterRadius;
            _maxDeviationRadius = parms.MaxDeviationRadius;
            _history            = new FilterDoubleExponentialData();
        }
Example #3
0
        /// <summary>
        /// Create an exponential smoothing joint with custom configuration values.
        /// </summary>
        /// <param name="jointType">The joint type to create</param>
        /// <param name="parameters">An <c>ExponentialSmoothingParameters</c> object</param>
        public ExponentialJoint(JointType jointType, ISmootherParameters parameters = null)
            : base(jointType)
        {
            var parms = parameters as ExponentialSmoothingParameters;

            if (parms == null)
                parms = new ExponentialSmoothingParameters();

            _smoothing = parms.Smoothing;
            _correction = parms.Correction;
            _prediction = parms.Prediction;
            // Check for divide by zero. Use an epsilon of a 10th of a millimeter
            _jitterRadius = Math.Max(0.0001f, parms.JitterRadius);
            _maxDeviationRadius = parms.MaxDeviationRadius;
            _history = new FilterDoubleExponentialData();
        }
Example #4
0
        /// <summary>
        /// Create an exponential smoothing joint with custom configuration values.
        /// </summary>
        /// <param name="jointType">The joint type to create</param>
        /// <param name="parameters">An <c>ExponentialSmoothingParameters</c> object</param>
        public ExponentialJoint(JointType jointType, ISmootherParameters parameters = null)
            : base(jointType)
        {
            var parms = parameters as ExponentialSmoothingParameters;

            if (parms == null)
            {
                parms = new ExponentialSmoothingParameters();
            }

            _smoothing  = parms.Smoothing;
            _correction = parms.Correction;
            _prediction = parms.Prediction;
            // Check for divide by zero. Use an epsilon of a 10th of a millimeter
            _jitterRadius       = Math.Max(0.0001f, parms.JitterRadius);
            _maxDeviationRadius = parms.MaxDeviationRadius;
            _history            = new FilterDoubleExponentialData();
        }