浏览代码

about to clean up code

/docs-update
Hunter-Unity 5 年前
当前提交
7b35627d
共有 7 个文件被更改,包括 3043 次插入11 次删除
  1. 8
      Project/Assets/ML-Agents/Examples/Walker/Prefabs/DynamicPlatformWalker.prefab
  2. 998
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamic.unity
  3. 24
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgentDynamic.cs
  4. 1001
      Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic 1.nn
  5. 11
      Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic 1.nn.meta
  6. 1001
      Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic.nn
  7. 11
      Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic.nn.meta

8
Project/Assets/ML-Agents/Examples/Walker/Prefabs/DynamicPlatformWalker.prefab


m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3916531708190007741}
serializedVersion: 2
m_Mass: 3
m_Mass: 5
m_Drag: 0.05
m_AngularDrag: 0.05
m_UseGravity: 1

m_Name:
m_EditorClassIdentifier:
m_BrainParameters:
VectorObservationSize: 223
VectorObservationSize: 233
m_Model: {fileID: 11400000, guid: e1adbf3a9d04441259d6327d42fcce3d, type: 3}
m_Model: {fileID: 11400000, guid: b0c510a5ce7f1453fa3a3607a94c1fbb, type: 3}
m_InferenceDevice: 0
m_BehaviorType: 0
m_BehaviorName: WalkerDynamic

armR: {fileID: 3916531709307986932}
forearmR: {fileID: 3916531709090053250}
handR: {fileID: 3916531709806445448}
cubeRotation: {x: 0, y: 0, z: 0, w: 0}
hipsRotation: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &6065910098925129089
MonoBehaviour:
m_ObjectHideFlags: 0

998
Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamic.unity
文件差异内容过多而无法显示
查看文件

24
Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgentDynamic.cs


// 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)
if (bp.rb.transform != hips && bp.rb.transform != handL && bp.rb.transform != handR &&
bp.rb.transform != footL && bp.rb.transform != footR)
// if (bp.rb.transform != hips && bp.rb.transform != handL && bp.rb.transform != handR &&
// bp.rb.transform != footL && bp.rb.transform != footR)
if (bp.rb.transform != hips && bp.rb.transform != handL && bp.rb.transform != handR)
{
sensor.AddObservation(bp.rb.transform.localRotation);
// sensor.AddObservation(RagdollHelpers.GetJointRotation(bp.joint));

// m_WalkDir = target.position - hips.position;
// m_WalkDir = target.position - m_OrientationCube.transform.position;
// print($"fromTo: {Quaternion.FromToRotation(m_OrientationCube.transform.forward, hips.forward)} rotDelta {RagdollHelpers.GetRotationDelta(m_WalkDirLookRot, hips.rotation)}");
sensor.AddObservation(RagdollHelpers.GetRotationDelta(m_WalkDirLookRot, hips.rotation));
// sensor.AddObservation(RagdollHelpers.GetRotationDelta(m_WalkDirLookRot, hips.rotation));
// sensor.AddObservation(Quaternion.FromToRotation(m_OrientationCube.transform.forward, hips.forward));
// sensor.AddObservation(Quaternion.FromToRotation(m_OrientationCube.transform.forward, head.forward));
sensor.AddObservation(Quaternion.FromToRotation(hips.forward, m_OrientationCube.transform.forward));
sensor.AddObservation(Quaternion.FromToRotation(head.forward, m_OrientationCube.transform.forward));
sensor.AddObservation(RagdollHelpers.GetRotationDelta(m_WalkDirLookRot, head.rotation));
// sensor.AddObservation(RagdollHelpers.GetRotationDelta(m_WalkDirLookRot, head.rotation));
// m_TargetDirMatrix = Matrix4x4.TRS(Vector3.zero, m_LookRotation, Vector3.one);

+0.02f * Vector3.Dot(m_OrientationCube.transform.forward,
Vector3.ClampMagnitude(m_JdController.bodyPartsDict[hips].rb.velocity, 999))
// + 0.01f * Vector3.Dot(m_OrientationCube.transform.forward, hips.forward)
// + 0.01f * Vector3.Dot(m_OrientationCube.transform.forward, head.forward)
+ 0.01f * Vector3.Dot(m_OrientationCube.transform.forward, head.forward)
+ 0.01f * Quaternion.Dot(m_OrientationCube.transform.rotation, hips.rotation) //reward looking at
// + 0.01f * Quaternion.Dot(m_OrientationCube.transform.rotation, hips.rotation) //reward looking at
// + 0.01f * Quaternion.Dot(m_OrientationCube.transform.rotation, head.rotation) //reward looking at
// + 0.015f * (Quaternion.Dot(m_OrientationCube.transform.rotation, hips.rotation) - 1) *
// .5f //penalize not looking at

+ 0.005f * (head.position.y - shinL.position.y)
+ 0.005f * (head.position.y - shinR.position.y)
// + 0.005f * (head.position.y - shinL.position.y)
// + 0.005f * (head.position.y - shinR.position.y)
+ 0.005f * (head.position.y - footL.position.y)
+ 0.005f * (head.position.y - footR.position.y)
// + 0.01f * (head.position.y - shinL.position.y)
// + 0.01f * (head.position.y - shinR.position.y)
// - 0.005f * Mathf.Clamp(m_JdController.bodyPartsDict[handL].rb.velocity.magnitude,

1001
Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic 1.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic 1.nn.meta


fileFormatVersion: 2
guid: d3aa2ba6adaf54fd0aea9aeb2dc2e766
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}

1001
Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerDynamic.nn.meta


fileFormatVersion: 2
guid: b0c510a5ce7f1453fa3a3607a94c1fbb
ScriptedImporter:
fileIDToRecycleName:
11400000: main obj
11400002: model data
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 19ed1486aa27d4903b34839f37b8f69f, type: 3}
正在加载...
取消
保存