Beispiel #1
0
 // Raw stream packet from Apollo
 public static void rawStreamHandler(IntPtr cbr, UInt64 session, ApolloRawData rawData)
 {
     if (newRawDataEvent != null)
     {
         newRawDataEvent(rawData, sourceList[rawData.deviceID].handedness);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Get the average value of the first joints without the thumb
        /// </summary>
        /// <param name="deviceType"></param>
        /// <returns></returns>
        public double FirstJointAverage(device_type_t deviceType)
        {
            ApolloRawData raw = deviceType == device_type_t.GLOVE_LEFT ? _leftHandRaw : _rightHandRaw;

            double total = 0;

            total += raw.flex(1);
            total += raw.flex(3);
            total += raw.flex(5);
            total += raw.flex(7);
            return(total / 4);
        }
Beispiel #3
0
        /// <summary>
        /// Get the average value of all fingers combined on the given hand
        /// </summary>
        /// <param name="hand"></param>
        /// <returns></returns>
        public double TotalAverageValue(ApolloRawData raw)
        {
            int    sensors = 0;
            double total   = 0;

            // Loop through all of the finger values (except the thumb)
            for (int bendPosition = 0; bendPosition < 8; bendPosition++)
            {
                sensors++;
                total += raw.flex(bendPosition);
            }

            return(total / sensors);
        }
Beispiel #4
0
        public void newRawData(ApolloRawData data, GloveLaterality side)
        {
            if (!ShouldAcceptApolloData)
            {
                return;
            }

            switch (side)
            {
            case GloveLaterality.GLOVE_LEFT:
                // store the raw data
                _leftHandRaw = data;
                break;

            case GloveLaterality.GLOVE_RIGHT:
                // store the raw data
                _rightHandRaw = data;

                break;
            }
        }