Esempio n. 1
0
 /// <summary>
 /// Represent the movement of a SINGLE actuator. timeout is how long the motion is expected to take (plus some) before the motion should be finished. If it isnt the motion should "fail" as something likely went wrong.
 /// </summary>
 /// <param name="timeout"></param>
 /// <param name="jointVal"></param>
 /// <param name="actuatorID"></param>
 public armCommand( double jointVal, armConstants.armActuatorID actuatorID)
 {
     target = jointVal;
     ID = actuatorID;
 }
Esempio n. 2
0
 private bool transmitMove(armConstants.armActuatorID ID, double target)
 {
     try
     {
         switch (ID)
         {
             case armConstants.armActuatorID.elbow:
                 armIn.manuallySetElbow(target);
                 break;
             case armConstants.armActuatorID.shoulder:
                 armIn.manuallySetShoulder(target);
                 break;
             case armConstants.armActuatorID.turnTable:
                 armIn.manuallySetTurnTable(target);
                 break;
             case armConstants.armActuatorID.grip:
                 armIn.manuallySetGripper((int)target);
                 break;
         }
         return true;
     }
     catch
     {
         return false;
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Represent the movement of a SINGLE actuator. timeout is how long the motion is expected to take (plus some) before the motion should be finished. If it isnt the motion should "fail" as something likely went wrong.
 /// </summary>
 /// <param name="timeout"></param>
 /// <param name="jointVal"></param>
 /// <param name="actuatorID"></param>
 public armMovement(int timeout, double jointVal, armConstants.armActuatorID actuatorID)
 {
     waitTime = timeout;
     target = jointVal;
     ID = actuatorID;
 }
Esempio n. 4
0
 private bool inRange(double p, armConstants.armActuatorID armActuatorID)
 {
     switch (armActuatorID)
     {
         case armConstants.armActuatorID.elbow:
             return (Math.Abs(armIn.getActualElbowVal() - p) <= armConstants.MACRO_TOLERANCE);
         case armConstants.armActuatorID.grip:
             return (Math.Abs(armIn.getActualGripperVal() - p) <= armConstants.MACRO_TOLERANCE);
         case armConstants.armActuatorID.shoulder:
             return (Math.Abs(armIn.getActualShoulderVal() - p) <= armConstants.MACRO_TOLERANCE);
         case armConstants.armActuatorID.turnTable:
             return (Math.Abs(armIn.getActualTurnTableVal() - p) <= armConstants.MACRO_TOLERANCE);
         default:
             return false;
     }
 }