Exemplo n.º 1
0
    public void Reset(TypingGender gender)
    {
      ToolBox.VectorReset(ref armCM);
      ToolBox.VectorReset(ref armLastCM);
      ToolBox.VectorReset(ref upperCM);
      ToolBox.VectorReset(ref upperLastCM);
      ToolBox.VectorReset(ref foreCM);
      ToolBox.VectorReset(ref foreLastCM);
      SetGenderValue(gender);
      theta = 0;
      lastTheta = 0;
      elbowAngleSum = 0;
      wristAngleSum = 0;

      ToolBox.VectorReset(ref displacement);
      ToolBox.VectorReset(ref currentVelocity);
      ToolBox.VectorReset(ref lastVelocity);
      ToolBox.VectorReset(ref measuredAcceleration);

      angularAcc = 0;
      ToolBox.VectorReset(ref inertialTorque);
      ToolBox.VectorReset(ref inertialTorqueWithoutMass);

      //Force at the CoM related variables
      comMeasuredAcc = 0;
      comHumanAcc = 0;
      comHumanAccSum = 0;

      comHumanForce = 0;
      maxComHumanForcePercent = 0;
      forceBasedEndurance = 0;

      comHumanForceSum = 0;
      avgComHumanForce = 0;
      maxAvgComHumanForcePercent = 0;
      avgForceBasedEndurance = 0;

      forceBasedEnduranceLostPercent = 0; //these two are only calculated for the avg force
      forceBasedEnduranceLostRate = 0;

      //Torque at the shoulder related variables
      measuredTorque = 0;
      measuredTorqueSum = 0;
      avgMeasuredTorque = 0;
      gravityTorque = 0;
      gravityTorqueSum = 0;
      avgGravityTorque = 0;
      inertialTorqueL = 0;
      inertialTorqueSum = 0;
      avgInertialTorque = 0;

      humanTorque = 0;
      maxHumanTorquePercent = 0;
      torqueBasedEndurance = 0;

      humanTorqueSum = 0;
      avgHumanTorque = 0;
      maxAvgHumanTorquePercent = 0;
      avgTorqueBasedEndurance = 0;

      torqueBasedEnduranceLostPercent = 0; //these two are only calculated for the avg torque
      torqueBasedEnduranceLostRate = 0;

      //These two variables are used to calculate the avg theta and center of mass for the overall measurement
      thetaAngleSum = 0;
      armCMLenght = 0;
    }
Exemplo n.º 2
0
    private void SetGenderValue(TypingGender gender)
    {
      if (gender == TypingGender.Male)
      {
        armMass = MALE_UPPERARM_MASS + MALE_FOREARM_MASS + HAND_MASS;
        maxForce = MALE_MAX_FORCE;
        maxTorque = maxForce * MALE_UPPERARM_LENGHT / 100 + 
                    (MALE_UPPERARM_MASS * GRAVITY_ACCELERATION * MALE_UPPER_ARM_CENTER_OF_GRAVITY / 100 +
                    MALE_FOREARM_MASS * GRAVITY_ACCELERATION * (MALE_UPPERARM_LENGHT + MALE_FOREARM_CENTER_OF_GRAVITY) / 100 +
                    HAND_MASS * GRAVITY_ACCELERATION * (MALE_UPPERARM_LENGHT + MALE_FOREARM_LENGHT + MALE_HAND_CENTER_OF_GRAVITY) / 100);

        upperArmWeightProportion = MALE_UPPERARM_MASS / armMass;//Segment weight at the 50th percentile, male
        
        forearmAndHandCenterOfGravity = ((MALE_FOREARM_LENGHT + MALE_HAND_CENTER_OF_GRAVITY) - MALE_FOREARM_CENTER_OF_GRAVITY) * (HAND_MASS / (MALE_FOREARM_MASS + HAND_MASS)) + MALE_FOREARM_CENTER_OF_GRAVITY;
        foreArmAndHandCenterOfGravityRatio = forearmAndHandCenterOfGravity / (MALE_FOREARM_LENGHT + MALE_HAND_LENGHT);
        
      }
      else
      {
        armMass = FEMALE_UPPERARM_MASS + FEMALE_FOREARM_MASS + HAND_MASS;
        maxForce = FEMALE_MAX_FORCE;
        maxTorque = maxForce * FEMALE_UPPERARM_LENGHT / 100 +
                    (FEMALE_UPPERARM_MASS * GRAVITY_ACCELERATION * FEMALE_UPPER_ARM_CENTER_OF_GRAVITY / 100 +
                    FEMALE_FOREARM_MASS * GRAVITY_ACCELERATION * (FEMALE_UPPERARM_LENGHT + FEMALE_FOREARM_CENTER_OF_GRAVITY) / 100 +
                    HAND_MASS * GRAVITY_ACCELERATION * (FEMALE_UPPERARM_LENGHT + FEMALE_FOREARM_LENGHT + FEMALE_HAND_CENTER_OF_GRAVITY) / 100);
        upperArmWeightProportion = FEMALE_UPPERARM_MASS / armMass;//Segment weight at the 50th percentile, male
        forearmAndHandCenterOfGravity = ((FEMALE_FOREARM_LENGHT + FEMALE_HAND_CENTER_OF_GRAVITY) - FEMALE_FOREARM_CENTER_OF_GRAVITY) * (HAND_MASS / (FEMALE_FOREARM_MASS + HAND_MASS)) + FEMALE_FOREARM_CENTER_OF_GRAVITY;
        foreArmAndHandCenterOfGravityRatio = forearmAndHandCenterOfGravity / (FEMALE_FOREARM_LENGHT + FEMALE_HAND_LENGHT);
      }
    }