/// <summary>
        /// Input manager that includes a single VIVE Tracker as sensor and a linear kinematic synergy as reference generator.
        /// </summary>
        /// <param name="sensorManager">The VIVE Tracker object to be used as sensor.</param>
        /// <param name="xBar">The initial condition for the references.</param>
        /// <param name="xMin">The lower limits for the references.</param>
        /// <param name="xMax">The upper limits for the references.</param>
        public KinematicVIVEInputManager(VIVETrackerManager sensorManager, float[] xBar, float[] xMin, float[] xMax, float[] theta, float[] thetaMin, float[] thetaMax)
        {
            if (sensorManager == null)
            {
                throw new System.ArgumentNullException("The provided sensor manager is empty.");
            }

            this.sensorManager = sensorManager;
            // Create a custom KSRG
            referenceGenerator = new LinearKinematicSynergy(xBar, xMin, xMax, theta, thetaMin, thetaMax);
        }
Example #2
0
 /// <summary>
 /// Sets the synergy value for a linear kinematic synergy type reference generator.
 /// </summary>
 /// <param name="channel">The channel number.</param>
 /// <param name="theta">The new synergy value.</param>
 private void SetLinKinSynergy(int channel, float theta)
 {
     // Check that the active reference generator is of the right type
     if (GetActiveReferenceGeneratorType() == ReferenceGeneratorType.LinearKinematicSynergy)
     {
         // Type cast to be able to access the right method
         LinearKinematicSynergy typeCastActiveGenerator = (LinearKinematicSynergy)activeGenerator;
         typeCastActiveGenerator.UpdateParameter(channel, theta);
     }
     else
     {
         throw new System.ArgumentException("Invalid value reference generator. Active RG type: " + GetActiveReferenceGeneratorType());
     }
 }
        /// <summary>
        /// Input manager that includes a single VIVE Tracker as sensor and a linear kinematic synergy as reference generator.
        /// </summary>
        /// <param name="sensorManager">The VIVE Tracker object to be used as sensor.</param>
        public KinematicVIVEInputManager(VIVETrackerManager sensorManager)
        {
            if (sensorManager == null)
            {
                throw new System.ArgumentNullException("The provided sensor manager is empty.");
            }

            this.sensorManager = sensorManager;
            // Create a single DOF KSRG
            float[] xBar     = { 0.0f };
            float[] xMin     = { -5.0f };
            float[] xMax     = { 145.0f };
            float[] theta    = { 1.0f };
            float[] thetaMin = { 0.8f };
            float[] thetaMax = { 2.4f };
            referenceGenerator = new LinearKinematicSynergy(xBar, xMin, xMax, theta, thetaMin, thetaMax);
        }