Example #1
0
        void armIn_targetWristChanged(wristPositionData newPosition)
        {
            if (newPosition.upVal > 0)
            {
                upInd.setIndicatorState(toggleIndicator.indicatorState.Green);
            }
            else
            {
                upInd.setIndicatorState(toggleIndicator.indicatorState.Off);
            }

            if (newPosition.leftVal > 0)
            {
                leftInd.setIndicatorState(toggleIndicator.indicatorState.Green);
            }
            else
            {
                leftInd.setIndicatorState(toggleIndicator.indicatorState.Off);
            }

            if (newPosition.rightVal > 0)
            {
                rightInd.setIndicatorState(toggleIndicator.indicatorState.Green);
            }
            else
            {
                rightInd.setIndicatorState(toggleIndicator.indicatorState.Off);
            }
        }
Example #2
0
 void armInput_targetWristChanged(wristPositionData newPosition)
 {
     if (!newPosition.Equals(oldWrist) && wristTimerExpired)
     {
         oldWrist = newPosition;
         wristTimerExpired = false;
         handArduino.write("U:" + newPosition.upVal);
         handArduino.write("L:" + newPosition.leftVal);
         handArduino.write("R:" + newPosition.rightVal);
     }
 }
Example #3
0
 private void wristUpdate()
 {
     while (true)
     {
         lock (wristSync)
         {
             if(newWristPositions){
                 wristPositionData currentData = new wristPositionData((int)upMag, (int)leftMag, (int)rightMag);
                 if (targetWristChanged != null)
                 {
                     targetWristChanged(currentData);
                 }
             }
         }
         Thread.Sleep(100);
     }
 }
Example #4
0
 void armInput_targetWristChanged(wristPositionData newPosition)
 {
     lock (WR_LOCK)
     {
         if (!wristPos.Equals(newPosition))
         {
             newWrist = true;
             wristPos = newPosition;
         }
     }
 }
Example #5
0
 /// <summary>
 /// Overridden version of the equals method. Determines if the values within the wristPosition are the same.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public bool Equals(wristPositionData obj)
 {
     try
     {
         if (obj.GetType() != base.GetType())
         {
             return false;
         }
         wristPositionData tempOther = (wristPositionData)obj;
         if (tempOther.leftVal == leftVal && tempOther.rightVal == rightVal && tempOther.upVal == upVal)
         {
             return true;
         }
         return false;
     }
     catch
     {
         return false;
     }
 }