示例#1
0
        /// <summary>
        /// Create a Kalman 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 KalmanJoint(JointType jointType, ISmootherParameters parameters = null)
            : base(jointType)
        {
            var parms = parameters as KalmanSmoothingParameters;

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

            _measurementUncertainty = new Vector3(parms.MeasurementUncertainty);
            _jitterRadius = parms.JitterRadius;
        }
示例#2
0
        /// <summary>
        /// Create a Kalman 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 KalmanJoint(JointType jointType, ISmootherParameters parameters = null)
            : base(jointType)
        {
            var parms = parameters as KalmanSmoothingParameters;

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

            _measurementUncertainty = new Vector3(parms.MeasurementUncertainty);
            _jitterRadius           = parms.JitterRadius;
        }
示例#3
0
        /// <summary>
        /// Creates an instance of a <c>SmoothedBody</c> using the referenced smoothing
        /// parameters object.
        /// </summary>
        public SmoothedBody(ISmootherParameters parameters)
            : base()
        {
            ISmoother smoother = (ISmoother)Activator.CreateInstance(typeof(T));

            _joints.Clear();
            _jointOrientations.Clear();
            foreach (var jointType in JointTypeEx.AllJoints)
            {
                _joints.Add(jointType, (IJoint)Activator.CreateInstance(smoother.CustomJointType, (JointType)jointType, parameters));
                _jointOrientations.Add(jointType, (IJointOrientation)Activator.CreateInstance(smoother.CustomJointOrientationType, (JointType)jointType, parameters));
            }
        }
示例#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();
        }
示例#5
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();
        }
示例#6
0
 /// <summary>
 /// Create a Kalman 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 KalmanJointOrientation(JointType jointType, ISmootherParameters parameters = null)
     : base(jointType)
 {
 }
示例#7
0
 /// <summary>
 /// Create an instance of a <c>SmoothedBodyList</c> collection. Accepts an
 /// optional parameters object of the type appropriate for the specified
 /// <c>ISmoother</c>.
 /// </summary>
 public SmoothedBodyList(ISmootherParameters parameters = null)
 {
     _parameters = parameters;
 }
 /// <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 ExponentialJointOrientation(JointType jointType, ISmootherParameters parameters = null)
     : base(jointType)
 {
 }