/// <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); }
/// <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); }