public void onChangePose() { current = (TrainingUnit.Posture)dropDown.value; currentList = PostureDataHandler.instance.getSublist(current); index = 0; Debug.Log("Got " + currentList.Count + " elements."); }
public void saveCurrentAs(TrainingUnit.Posture posture) { if (gameObject.activeInHierarchy) { PostureDataHandler.instance.addTrainigData(new TrainingUnit(posture, hand)); hand = new AngleBasedHandModel(); } else { Debug.LogError("Tried to save hand, eventhough not active!"); } }
void Start() { UserStudyData.instance.remainingIts--; overridePosture = UserStudyData.instance.posture; float targetdiscomfort = UnityEngine.Random.Range(0, 1000); StartCoroutine(getNewRandomHand(targetdiscomfort)); if (UserStudyData.instance.right) { outputHand.transform.localScale = new Vector3(-outputHand.transform.localScale.x, outputHand.transform.localScale.y, outputHand.transform.localScale.z); } outputHand.visualizeHand(targethand); }
public List <TrainingUnit> getSublist(TrainingUnit.Posture current) { List <TrainingUnit> result = new List <TrainingUnit>(); foreach (TrainingUnit tu in trainingData) { if (tu.posture == current) { result.Add(tu); } } return(result); }
public static float getMinDistanceToPosture(TrainingUnit.Posture posture, AngleBasedHandModel hand) { if (comparePosture != posture || compareData == null || compareData.Count == 0) { comparePosture = posture; reload(); } float result = float.PositiveInfinity; foreach (TrainingUnit tu in compareData) { if (result > hand.euclidianDistanceFingers(tu.hand)) { result = hand.euclidianDistanceFingers(tu.hand); } } return(result); }
public TrainingUnit getRand(TrainingUnit.Posture post) { return(getSublist(post)[UnityEngine.Random.Range(0, getSublist(post).Count - 1)]); }
public void deleteAll(TrainingUnit.Posture current) { trainingData.RemoveAll(x => x.posture == current); Debug.Log("Deleted all " + current + " training data."); saveData(); }
public poseCompareObject(float dist, TrainingUnit.Posture post) { distance = dist; posture = post; }
public static bool isHolding(TrainingUnit.Posture posture, AngleBasedHandModel hand) { return(getMinDistanceToPosture(posture, hand) <= postureHoldingThresh); }