public override void InitializeAgent()
    {
        m_JdController = GetComponent <JointDriveController>();
        m_JdController.SetupBodyPart(hips);
        m_JdController.SetupBodyPart(chest);
        m_JdController.SetupBodyPart(spine);
        m_JdController.SetupBodyPart(head);
        m_JdController.SetupBodyPart(thighL);
        m_JdController.SetupBodyPart(shinL);
        m_JdController.SetupBodyPart(footL);
        m_JdController.SetupBodyPart(thighR);
        m_JdController.SetupBodyPart(shinR);
        m_JdController.SetupBodyPart(footR);
        m_JdController.SetupBodyPart(armL);
        m_JdController.SetupBodyPart(forearmL);
        m_JdController.SetupBodyPart(handL);
        m_JdController.SetupBodyPart(armR);
        m_JdController.SetupBodyPart(forearmR);
        m_JdController.SetupBodyPart(handR);

        m_HipsRb  = hips.GetComponent <Rigidbody>();
        m_ChestRb = chest.GetComponent <Rigidbody>();
        m_SpineRb = spine.GetComponent <Rigidbody>();

        var academy = FindObjectOfType <WalkerAcademy>();

        m_ResetParams = academy.resetParameters;

        SetResetParameters();
    }
    public override void InitializeAgent()
    {
        m_JdController = GetComponent <JointDriveController>();
        m_JdController.SetupBodyPart(hips);
        m_JdController.SetupBodyPart(chest);
        m_JdController.SetupBodyPart(spine);
        m_JdController.SetupBodyPart(head);
        m_JdController.SetupBodyPart(thighL);
        m_JdController.SetupBodyPart(shinL);
        m_JdController.SetupBodyPart(footL);
        m_JdController.SetupBodyPart(thighR);
        m_JdController.SetupBodyPart(shinR);
        m_JdController.SetupBodyPart(footR);
        m_JdController.SetupBodyPart(armL);
        m_JdController.SetupBodyPart(forearmL);
        m_JdController.SetupBodyPart(handL);
        m_JdController.SetupBodyPart(armR);
        m_JdController.SetupBodyPart(forearmR);
        m_JdController.SetupBodyPart(handR);

        m_HipsRb  = hips.GetComponent <Rigidbody>();
        m_ChestRb = chest.GetComponent <Rigidbody>();
        m_SpineRb = spine.GetComponent <Rigidbody>();

        m_ResetParams = Academy.Instance.FloatProperties;

        SetResetParameters();
    }
    public override void Initialize()
    {
        orientationCube.UpdateOrientation(hips, target.transform);

        //Setup each body part
        m_JdController = GetComponent <JointDriveController>();
        m_JdController.SetupBodyPart(hips);
        m_JdController.SetupBodyPart(chest);
        m_JdController.SetupBodyPart(spine);
        m_JdController.SetupBodyPart(head);
        m_JdController.SetupBodyPart(thighL);
        m_JdController.SetupBodyPart(shinL);
        m_JdController.SetupBodyPart(footL);
        m_JdController.SetupBodyPart(thighR);
        m_JdController.SetupBodyPart(shinR);
        m_JdController.SetupBodyPart(footR);
        m_JdController.SetupBodyPart(armL);
        m_JdController.SetupBodyPart(forearmL);
        m_JdController.SetupBodyPart(handL);
        m_JdController.SetupBodyPart(armR);
        m_JdController.SetupBodyPart(forearmR);
        m_JdController.SetupBodyPart(handR);

        m_ResetParams = Academy.Instance.EnvironmentParameters;

        SetResetParameters();
    }
Exemple #4
0
    public override void InitializeAgent()
    {
        jdController = GetComponent <JointDriveController>();
        jdController.SetupBodyPart(hips);
        jdController.SetupBodyPart(chest);
        jdController.SetupBodyPart(spine);
        jdController.SetupBodyPart(head);
        jdController.SetupBodyPart(thighL);
        jdController.SetupBodyPart(shinL);
        jdController.SetupBodyPart(footL);
        jdController.SetupBodyPart(thighR);
        jdController.SetupBodyPart(shinR);
        jdController.SetupBodyPart(footR);
        jdController.SetupBodyPart(armL);
        jdController.SetupBodyPart(forearmL);
        jdController.SetupBodyPart(handL);
        jdController.SetupBodyPart(armR);
        jdController.SetupBodyPart(forearmR);
        jdController.SetupBodyPart(handR);

        SaveState();

        parentPos      = this.transform.position;
        parentRotation = this.transform.rotation;
    }
        public override void InitializeAgent()
        {
            Debug.Log($"Initialising agent in: {GetComponentInParent<Transform>().name}");
            Debug.Log($"Current brain: {brain}");
            base.InitializeAgent();
            decisionCounter = 0;
            _limbsTransform = new List <Transform>();
            _limbsBodyParts = new List <AnhaBodyPart>();

            _agentRb        = Root.GetComponent <Rigidbody>();
            _areaBounds     = Floor.GetComponent <Collider>().bounds;
            _groundRenderer = Floor.GetComponent <Renderer>();
            _groundMaterial = _groundRenderer.material;

            _targets = TargetsContainer.GetComponentsInChildren <Transform>().Skip(1).ToList();

            // Automatically adding all the bones of limbs;
            // Each limb ought to end with a child object with tag "hand"
            _hands = Finder.ChildrenWithTag(LimbsContainer.transform, "hand");
            SetLimbs();

            // SETTING UP THE joints CONTROLLER
            _jdController = GetComponent <JointDriveController>();
            _jdController.SetupBodyPart(Root.transform);
            _limbsTransform.ForEach(bp => _jdController.SetupBodyPart(bp));

            SetDirectionToClosestTarget();
        }
Exemple #6
0
    public override void Initialize()
    {
        m_OrientationCube    = GetComponentInChildren <OrientationCubeController>();
        m_DirectionIndicator = GetComponentInChildren <DirectionIndicator>();

        //Setup each body part
        m_JdController = GetComponent <JointDriveController>();
        m_JdController.SetupBodyPart(hips);
        m_JdController.SetupBodyPart(chest);
        m_JdController.SetupBodyPart(spine);
        m_JdController.SetupBodyPart(head);
        m_JdController.SetupBodyPart(thighL);
        m_JdController.SetupBodyPart(shinL);
        m_JdController.SetupBodyPart(footL);
        m_JdController.SetupBodyPart(thighR);
        m_JdController.SetupBodyPart(shinR);
        m_JdController.SetupBodyPart(footR);
        m_JdController.SetupBodyPart(armL);
        m_JdController.SetupBodyPart(forearmL);
        m_JdController.SetupBodyPart(handL);
        m_JdController.SetupBodyPart(armR);
        m_JdController.SetupBodyPart(forearmR);
        m_JdController.SetupBodyPart(handR);

        m_ResetParams = Academy.Instance.EnvironmentParameters;

        SetResetParameters();
    }
    public override void Initialize()
    {
        Controller = GetComponent <JointDriveController>();

        for (int i = 0; i < Parts.Count; i++)
        {
            Controller.SetupBodyPart(Parts[i]);
        }
    }
        InitializeAgent()
        {
            base.InitializeAgent();

            ReConfigSystemSettingsForRobot();

            jdController        = GetComponent <JointDriveController>();
            currentDecisionStep = 1;

            InitializeBody();
        } // InitializeAgent
Exemple #9
0
    Matrix4x4 m_TargetDirMatrix;           //Matrix used by agent as orientation reference

    public override void Initialize()
    {
        m_JdController    = GetComponent <JointDriveController>();
        m_DirToTarget     = target.position - bodySegment0.position;
        m_LookRotation    = Quaternion.LookRotation(m_DirToTarget);
        m_TargetDirMatrix = Matrix4x4.TRS(Vector3.zero, m_LookRotation, Vector3.one);

        //Setup each body part
        m_JdController.SetupBodyPart(bodySegment0);
        m_JdController.SetupBodyPart(bodySegment1);
        m_JdController.SetupBodyPart(bodySegment2);
        m_JdController.SetupBodyPart(bodySegment3);
    }
Exemple #10
0
    public override void Initialize()
    {
        SetAgentType();

        m_OrientationCube    = GetComponentInChildren <OrientationCubeController>();
        m_DirectionIndicator = GetComponentInChildren <DirectionIndicator>();
        m_JdController       = GetComponent <JointDriveController>();

        //Setup each body part
        m_JdController.SetupBodyPart(body);
        m_JdController.SetupBodyPart(leg0Upper);
        m_JdController.SetupBodyPart(leg0Lower);
        m_JdController.SetupBodyPart(leg1Upper);
        m_JdController.SetupBodyPart(leg1Lower);
    }
Exemple #11
0
        public override void InitializeAgent()
        {
            for (int i = 0; i < _rigs.Length; i++)
            {
                _rigs[i].EvaluateStart();
                _rigs[i].Reset();
            }

            _jdController = GetComponent <JointDriveController>();
            _jdController.SetupBodyPart(_armBase.transform);
            _jdController.SetupBodyPart(_armLow.transform);
            _jdController.SetupBodyPart(_armHigh.transform);
            _jdController.SetupBodyPart(_armTop.transform);
            _jdController.SetupBodyPart(_armRotator.transform);
        }
Exemple #12
0
    public override void InitializeAgent()
    {
        jdController        = GetComponent <JointDriveController>();
        currentDecisionStep = 1;

        //Setup each body part
        jdController.SetupBodyPart(body);
        jdController.SetupBodyPart(leg0Upper);
        jdController.SetupBodyPart(leg0Lower);
        jdController.SetupBodyPart(leg1Upper);
        jdController.SetupBodyPart(leg1Lower);
        jdController.SetupBodyPart(leg2Upper);
        jdController.SetupBodyPart(leg2Lower);
        jdController.SetupBodyPart(leg3Upper);
        jdController.SetupBodyPart(leg3Lower);
    }
Exemple #13
0
    public override void InitializeAgent()
    {
        m_JdController = GetComponent <JointDriveController>();
        m_DirToTarget  = target.position - body.position;


        //Setup each body part
        m_JdController.SetupBodyPart(body);
        m_JdController.SetupBodyPart(leg0Upper);
        m_JdController.SetupBodyPart(leg0Lower);
        m_JdController.SetupBodyPart(leg1Upper);
        m_JdController.SetupBodyPart(leg1Lower);
        m_JdController.SetupBodyPart(leg2Upper);
        m_JdController.SetupBodyPart(leg2Lower);
        m_JdController.SetupBodyPart(leg3Upper);
        m_JdController.SetupBodyPart(leg3Lower);
    }
    public override void Initialize()
    {
        orientationCube.UpdateOrientation(body, target.transform);

        m_JdController = GetComponent <JointDriveController>();

        //Setup each body part
        m_JdController.SetupBodyPart(body);
        m_JdController.SetupBodyPart(leg0Upper);
        m_JdController.SetupBodyPart(leg0Lower);
        m_JdController.SetupBodyPart(leg1Upper);
        m_JdController.SetupBodyPart(leg1Lower);
        m_JdController.SetupBodyPart(leg2Upper);
        m_JdController.SetupBodyPart(leg2Lower);
        m_JdController.SetupBodyPart(leg3Upper);
        m_JdController.SetupBodyPart(leg3Lower);
    }
Exemple #15
0
    private Vector3 m_StartingPos; //starting position of the agent

    public override void Initialize()
    {
        SpawnTarget(TargetPrefab, transform.position); //spawn target

        m_StartingPos        = bodySegment0.position;
        m_OrientationCube    = GetComponentInChildren <OrientationCubeController>();
        m_DirectionIndicator = GetComponentInChildren <DirectionIndicator>();
        m_JdController       = GetComponent <JointDriveController>();

        UpdateOrientationObjects();

        //Setup each body part
        m_JdController.SetupBodyPart(bodySegment0);
        m_JdController.SetupBodyPart(bodySegment1);
        m_JdController.SetupBodyPart(bodySegment2);
        m_JdController.SetupBodyPart(bodySegment3);
    }
        InitializeAgent()
        {
            base.InitializeAgent();

            ReConfigSystemSettingsForRobot();

            jdController        = GetComponent <JointDriveController>();
            currentDecisionStep = 1;

            InitializeBody();

            PlayerReinitializor = new TransformReinitializor(
                this.gameObject,
                Vector3.zero, Vector3.zero,
                Vector3.zero, Vector3.zero,
                Vector3.zero, Vector3.zero);
            PlayerReinitializor.Reinitialize();
        } // InitializeAgent
 public override void InitializeAgent()
 {
     jdController = GetComponent <JointDriveController>();
     // Handle starting/communication with api data
     cell = GetComponent <Cell>();
     if (requestApiData)
     {
         PostGene postGene = transform.gameObject.AddComponent <PostGene>();
         StartCoroutine(postGene.getCell(cellId));
         cell.partNb    = partNb;
         cell.threshold = threshold;
     }
     else
     {
         cell.initGerms(partNb, threshold);
     }
     currentDecisionStep = 1;
 }
Exemple #18
0
    public override void Initialize()
    {
        SpawnTarget(dynamicTargetPrefab, transform.position);
        m_OrientationCube = GetComponentInChildren <OrientationCubeController>();
        //m_DirectionIndicator = GetComponentInChildren<DirectionIndicator>();
        m_JdController = GetComponent <JointDriveController>();

        //Setup each body part
        m_JdController.SetupBodyPart(body);
        m_JdController.SetupBodyPart(leg0Upper);
        m_JdController.SetupBodyPart(leg0Lower);
        m_JdController.SetupBodyPart(leg1Upper);
        m_JdController.SetupBodyPart(leg1Lower);
        m_JdController.SetupBodyPart(leg2Upper);
        m_JdController.SetupBodyPart(leg2Lower);
        m_JdController.SetupBodyPart(leg3Upper);
        m_JdController.SetupBodyPart(leg3Lower);
    }
Exemple #19
0
 public override void InitializeAgent()
 {
     jdController = GetComponent <JointDriveController>();
     jdController.SetupBodyPart(hips);
     jdController.SetupBodyPart(chest);
     jdController.SetupBodyPart(spine);
     jdController.SetupBodyPart(head);
     jdController.SetupBodyPart(thighL);
     jdController.SetupBodyPart(shinL);
     jdController.SetupBodyPart(footL);
     jdController.SetupBodyPart(thighR);
     jdController.SetupBodyPart(shinR);
     jdController.SetupBodyPart(footR);
     jdController.SetupBodyPart(armL);
     jdController.SetupBodyPart(forearmL);
     jdController.SetupBodyPart(handL);
     jdController.SetupBodyPart(armR);
     jdController.SetupBodyPart(forearmR);
     jdController.SetupBodyPart(handR);
 }
Exemple #20
0
    Matrix4x4 m_TargetDirMatrix;           //Matrix used by agent as orientation reference

    public override void Initialize()
    {
        m_JdController    = GetComponent <JointDriveController>();
        m_DirToTarget     = target.position - bodySegment0.position;
        m_LookRotation    = Quaternion.LookRotation(m_DirToTarget);
        m_TargetDirMatrix = Matrix4x4.TRS(Vector3.zero, m_LookRotation, Vector3.one);

        //Setup each body part
        m_JdController.SetupBodyPart(bodySegment0);
        m_JdController.SetupBodyPart(bodySegment1);
        m_JdController.SetupBodyPart(bodySegment2);
        m_JdController.SetupBodyPart(bodySegment3);

        //We only want the head to detect the target
        //So we need to remove TargetContact from everything else
        //This is a temp fix till we can redesign
        DestroyImmediate(bodySegment1.GetComponent <TargetContact>());
        DestroyImmediate(bodySegment2.GetComponent <TargetContact>());
        DestroyImmediate(bodySegment3.GetComponent <TargetContact>());
    }
Exemple #21
0
    public override void Initialize()
    {
        action1 = -1f;
        action2 = -1f;
        action3 = -1f;
        action4 = -1f;

        pose0Time = Time.time + 10000;
        pose1Time = Time.time + 10000;
        pose2Time = Time.time + 10000;
        pose3Time = Time.time + 10000;
        pose4Time = Time.time + 10000;
        curangle  = 0.0f;
        curGrip   = 1f;
        gobj      = Instantiate(tc.gameObject, transform);
        //gobj.GetComponent<TargetController>().m_startingPos = transform.position;

        m_JdController = GetComponent <JointDriveController>();

        //Setup each body part
        m_JdController.SetupBodyPart(arm_base);
        m_JdController.SetupBodyPart(turner);
        m_JdController.SetupBodyPart(bone1);
        m_JdController.SetupBodyPart(bone2);
        m_JdController.SetupBodyPart(bone3);
        m_JdController.SetupBodyPart(hand);/*
                                            * m_JdController.SetupBodyPart(finger1);
                                            * m_JdController.SetupBodyPart(phalanx1);
                                            * m_JdController.SetupBodyPart(forePhalanx1);
                                            * m_JdController.SetupBodyPart(finger2);
                                            * m_JdController.SetupBodyPart(phalanx2);
                                            * m_JdController.SetupBodyPart(forePhalanx2);
                                            * m_JdController.SetupBodyPart(finger3);
                                            * m_JdController.SetupBodyPart(phalanx3);
                                            * m_JdController.SetupBodyPart(forePhalanx3);
                                            * m_JdController.SetupBodyPart(finger4);
                                            * m_JdController.SetupBodyPart(phalanx4);
                                            * m_JdController.SetupBodyPart(forePhalanx4);*/
    }
Exemple #22
0
    public override void InitializeAgent()
    {
        base.InitializeAgent();

        bodyrb = body.GetComponent <Rigidbody>();

        startPos = transform.position;
        startRot = transform.rotation;

        jointControl = GetComponent <JointDriveController>();

        //Setup the body parts in the joint controller
        jointControl.SetupBodyPart(body);

        for (int i = 0; i < 8; i++)
        {
            jointControl.SetupBodyPart(upperJoints[i]);
        }

        for (int i = 0; i < 8; i++)
        {
            jointControl.SetupBodyPart(lowerJoints[i]);
        }
    }
Exemple #23
0
    void Awake()
    {
        // Audio Setup
        audioSourceSFX = body.gameObject.AddComponent <AudioSource>();
        audioSourceSFX.spatialBlend = .75f;
        audioSourceSFX.minDistance  = .7f;
        audioSourceSFX.maxDistance  = 5;
        if (canBark)
        {
            StartCoroutine(BarkBarkGame());
        }

        //Joint Drive Setup
        jdController = GetComponent <JointDriveController>();
        jdController.SetupBodyPart(body);
        jdController.SetupBodyPart(leg0_upper);
        jdController.SetupBodyPart(leg0_lower);
        jdController.SetupBodyPart(leg1_upper);
        jdController.SetupBodyPart(leg1_lower);
        jdController.SetupBodyPart(leg2_upper);
        jdController.SetupBodyPart(leg2_lower);
        jdController.SetupBodyPart(leg3_upper);
        jdController.SetupBodyPart(leg3_lower);
    }