UnitySDK/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs
/// <summary>
/// Add relevant information on each body part to observations.
/// </summary>
Add relevant information on each body part to observations.
Add relevant information on each body part to observations .
public void CollectObservationBodyPart(BodyPart bp)
    {
        var rb = bp.rb;
        AddVectorObs(bp.groundContact.touchingGround ? 1 : 0); 
        AddVectorObs(rb.velocity);
        AddVectorObs(rb.angularVelocity);
        var localPosRelToHips = hips.InverseTransformPoint(rb.position);
        AddVectorObs(localPosRelToHips);
        if (bp.rb.transform != hips && bp.rb.transform != handL && bp.rb.transform != handR &&
            bp.rb.transform != footL && bp.rb.transform != footR && bp.rb.transform != head)
        {
            AddVectorObs(bp.currentXNormalizedRot);
            AddVectorObs(bp.currentYNormalizedRot);
            AddVectorObs(bp.currentZNormalizedRot);
            AddVectorObs(bp.currentStrength / m_JdController.maxJointForceLimit);
        }
    }
public void CollectObservationBodyPart ( BodyPart bp ) { var rb = bp . rb ; AddVectorObs ( bp . groundContact . touchingGround ? 1 : 0 ) ; AddVectorObs ( rb . velocity ) ; AddVectorObs ( rb . angularVelocity ) ; var localPosRelToHips = hips . InverseTransformPoint ( rb . position ) ; AddVectorObs ( localPosRelToHips ) ; if ( bp . rb . transform != hips && bp . rb . transform != handL && bp . rb . transform != handR && bp . rb . transform != footL && bp . rb . transform != footR && bp . rb . transform != head ) { AddVectorObs ( bp . currentXNormalizedRot ) ; AddVectorObs ( bp . currentYNormalizedRot ) ; AddVectorObs ( bp . currentZNormalizedRot ) ; AddVectorObs ( bp . currentStrength / m_JdController . maxJointForceLimit ) ; } }
Add relevant information on each body part to observations.
Add relevant information on each body part to observations .
// Is this bp touching the ground
bp
BodyPart