/// <summary>
    /// Initial setup, called at startup.
    /// </summary>
    /// <remarks>
    /// In future versions of ML-agents (> 0.14), InitializeAgent should be replaced by Initialize.
    /// </remarks>
    public override void InitializeAgent()
    {
        base.InitializeAgent();

        // Initialize joint controllers
        leftShoulder = new JointController("Left shoulder", leftShoulderJoint, new Vector3(-999, -999, -999), new Vector3(999, 999, 999)); //new Vector3(-999, -999, -25), new Vector3(999, 999, 25));
        leftUpperArm = new JointController("Left upper arm", leftUpperArmJoint, new Vector3(-999, -999, -999), new Vector3(999, 999, 999));
        leftElbow    = new JointController("Left elbow", leftElbowJoint, new Vector3(-999, -999, -999), new Vector3(999, 999, 999));       //new Vector3(-25, -999, -999), new Vector3(25, 999, 999));
        head         = new JointController("Head", headJoint, new Vector3(-999, -999, -999), new Vector3(999, 999, 999));

        // Retrieve the rubberArm and visuo-tactile stimulation objects from the environment
        rubberArmController = rubberArm.GetComponent <RubberArmController>();
        ballScript          = ballHandler.GetComponent <BallHandler>();
        vibScript           = vibHandler.GetComponent <VibHandler>();

        // Set the head rotation (and subsequently the camera perspective)
        head.SetRelativeJointAngles(new Vector3(15f, -20f));
    }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     ballHandlerScript = ballHandler.GetComponent <BallHandler>();
     vibHandlerScript  = vibHandler.GetComponent <VibHandler>();
 }