/// <summary> /// Collect observations. Number of calls to AddVectorObs should match with the /// observation vector size set in the Behavior Parameters inspector (of the Real body object). /// </summary> public override void CollectObservations() { // Shoulder extension/flexion AddVectorObs(leftShoulder.GetRelativeZ()); // Elbow extension/flexion AddVectorObs(leftElbow.GetRelativeX()); // Hand touch state (visual) AddVectorObs(ballScript.GetLastTouch()); // Hand touch state (tactile) AddVectorObs(vibScript.GetLastVib()); // Current Time AddVectorObs(Time.time); // Absolute hand distance error for logging AddVectorObs(Vector3.Distance(middleHand.transform.position, rubberArmController.getMiddleHand().transform.position)); // Horizontal distance AddVectorObs(middleHand.transform.position.z - rubberArmController.getMiddleHand().transform.position.z); // Shoulder extension/flexion AddVectorObs(rubberArmController.getRelativeLeftShoulderZ()); // Elbow extension/flexion AddVectorObs(rubberArmController.getRelativeLeftElbowX()); }
/// <summary> /// Get the elbow's x rotation relative to the initial position. /// </summary> /// <returns>float: The relative x rotation</returns> public float getRelativeLeftElbowX() { return(leftElbow.GetRelativeX()); }