浏览代码

add dist observ nn files

/active-variablespeed
HH 5 年前
当前提交
f06849e0
共有 16 个文件被更改,包括 4723 次插入1 次删除
  1. 110
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamic.unity
  2. 93
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamicVariableSpeed.unity
  3. 60
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerStatic.unity
  4. 60
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerStaticVariableSpeed.unity
  5. 334
      Project/Assets/ML-Agents/Examples/Walker/Scripts/AvgCenterOfMass.cs
  6. 11
      Project/Assets/ML-Agents/Examples/Walker/Scripts/AvgCenterOfMass.cs.meta
  7. 8
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud.meta
  8. 1001
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerDynamic.nn
  9. 11
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerDynamic.nn.meta
  10. 1001
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerDynamicVariableSpeed.nn
  11. 11
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerDynamicVariableSpeed.nn.meta
  12. 1001
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerStatic.nn
  13. 11
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerStatic.nn.meta
  14. 1001
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerStaticVariableSpeed.nn
  15. 11
      Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerStaticVariableSpeed.nn.meta

110
Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamic.unity


propertyPath: m_ConnectedAnchor.y
value: 0.5119997
objectReference: {fileID: 0}
- target: {fileID: 933197474575860228, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1671215519116747191, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_ConnectedAnchor.y

propertyPath: m_ConnectedAnchor.y
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 1883996561591094458, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1883996561704622956, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1883996561912795594, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1883996562098210516, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1883996563001548515, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1883996563055664880, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1883996563177015040, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1883996563204244531, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 1883996563246873412, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 6fa638926d5204c779388e48e6255ad8,
type: 3}
- target: {fileID: 6152130843188510807, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_LocalPosition.x

type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7372672485091388724, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 7964409123409882683, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}

type: 3}
propertyPath: m_ConnectedAnchor.y
value: 0.00000011920929
objectReference: {fileID: 0}
- target: {fileID: 8108397275169944668, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8108397275333010314, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8108397275511226106, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8108397275897801188, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8108397276519772608, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8108397276600889811, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8108397276846298228, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8108397276917983280, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8108397276936891139, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: walkingSpeed
value: 15
objectReference: {fileID: 0}
- target: {fileID: 8450292659616239746, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}

93
Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamicVariableSpeed.unity


type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: e23daf5f8436b4eea9c3570ac221f239,
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 7964409123409882683, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}

propertyPath: m_ConnectedAnchor.y
value: 0.00000011920929
objectReference: {fileID: 0}
- target: {fileID: 8450292659616239768, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8450292659631018923, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8450292659695529967, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8450292659953551944, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8450292660037585499, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8450292660726862463, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8450292661042169185, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8450292661233719313, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8450292661371981767, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 8669830784825731694, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_ConnectedAnchor.y

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 3ce107b4a79bc4eef83afde434932a68, type: 3}
--- !u!1 &2066646069 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7175173927432230581, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
m_PrefabInstance: {fileID: 1359243704}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2066646077
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2066646069}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 74cc05b039aa04d3da17ac9921123c22, type: 3}
m_Name:
m_EditorClassIdentifier:
active: 0
showCOMGizmos: 1
avgCOMWorldSpace: {x: 0, y: 2.9995303, z: 0.0034782607}
avgCOMVelocityWorldSpace: {x: 0, y: 0, z: 0}
previousAvgCOM: {x: 0, y: 0, z: 0}
avgCOMColor: {r: 0, g: 1, b: 0, a: 1}
bodyPartCOMColor: {r: 1, g: 0.92156863, b: 0.015686275, a: 1}
totalMass: 115
showBPPosRelToBody: 0
useTransformPoint: 0
useTransformVector: 0
useTransformDir: 0
showRBPos: 0
showRelPosVectorOnly: 0
showInverseTransformPointUnscaledRelToBody: 0
showInverseTransformPointRelToBody: 0
showInverseTransformVectorRelToBody: 0
showInverseTransformDirRelToBody: 0
body_T: {fileID: 0}
--- !u!1 &2095421678
GameObject:
m_ObjectHideFlags: 0

60
Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerStatic.unity


propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8228205183255162979, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 48d9838ba2af64512a599f6cecee6ce9,
type: 3}
- target: {fileID: 8228205183255163001, guid: c319a0a1c387d420a92f520b38ef875b,
type: 3}
propertyPath: m_Name

60
Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerStaticVariableSpeed.unity


m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1077752704035527913, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_Model
value:
objectReference: {fileID: 11400000, guid: 163fdf9da8bd8441c97f6e760543fa06,
type: 3}
- target: {fileID: 1077752704035527914, guid: d0b01030cfe47462398dd15595ca95de,
type: 3}
propertyPath: m_LocalPosition.x

334
Project/Assets/ML-Agents/Examples/Walker/Scripts/AvgCenterOfMass.cs


using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Used for visualizing the average center of mass of a ragdoll
/// </summary>
[DisallowMultipleComponent]
[ExecuteInEditMode]
public class AvgCenterOfMass : MonoBehaviour
{
/// <summary>
/// Enable to show a green spehere at the current center of mass.
/// </summary>
[Tooltip("Enable to show a green spehere at the current center of mass.")]
public bool active;
public bool showCOMGizmos = true;
public Vector3 avgCOMWorldSpace;
public Vector3 avgCOMVelocityWorldSpace;
public Vector3 previousAvgCOM;
public Color avgCOMColor = Color.green;
public Color bodyPartCOMColor = Color.yellow;
List<Rigidbody> rbList = new List<Rigidbody>();
public float totalMass;
[Tooltip("Visualize Relative Pos")]
public bool showBPPosRelToBody;
public bool useTransformPoint = true;
public bool useTransformVector;
public bool useTransformDir;
public bool showRBPos;
public bool showRelPosVectorOnly;
public bool showInverseTransformPointUnscaledRelToBody;
public bool showInverseTransformPointRelToBody;
public bool showInverseTransformVectorRelToBody;
public bool showInverseTransformDirRelToBody;
public Transform body_T;
void OnEnable()
{
SetUpRigidbodies();
}
void SetUpRigidbodies()
{
rbList.Clear();
totalMass = 0;
foreach(var item in GetComponentsInChildren<Rigidbody>())
{
rbList.Add(item);
totalMass += item.mass;
}
}
// void FixedUpdate()
// {
// if(Application.isPlaying)
// {
// avgCOMWorldSpace = Vector3.zero;
// foreach(var item in rbList)
// {
// if (item)
// {
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// }
// }
public Vector3 GetCoMWorldSpace()
{
Vector3 CoM = Vector3.zero;
avgCOMWorldSpace = Vector3.zero;
float c = 0f;
foreach(var item in rbList)
{
CoM += item.worldCenterOfMass * item.mass;
c += item.mass;
}
avgCOMWorldSpace = CoM/c;
avgCOMVelocityWorldSpace = (avgCOMWorldSpace - previousAvgCOM)/Time.fixedDeltaTime;
// Debug.DrawRay(avgCOMWorldSpace, avgCOMVelocityWorldSpace, Color.green,Time.fixedDeltaTime);
// Debug.DrawRay(avgCOMWorldSpace, Vector3.ProjectOnPlane( avgCOMVelocityWorldSpace, Vector3.up), Color.green,Time.fixedDeltaTime);
previousAvgCOM = avgCOMWorldSpace;
return avgCOMWorldSpace;
}
void FixedUpdate()
{
if(Application.isPlaying)
{
// avgCOMWorldSpace = Vector3.zero;
// foreach(var item in rbList)
// {
// if (item)
// {
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// if (active)
// {
GetCoMWorldSpace();
// }
// Vector3 CoM = Vector3.zero;
// avgCOMWorldSpace = Vector3.zero;
// float c = 0f;
//
// foreach(var item in rbList)
// {
// CoM += item.worldCenterOfMass * item.mass;
// c += item.mass;
// }
// avgCOMWorldSpace = CoM/c;
// avgCOMVelocityWorldSpace = previousAvgCOM - avgCOMWorldSpace;
// Debug.DrawRay(avgCOMWorldSpace, avgCOMVelocityWorldSpace, Color.green,Time.fixedDeltaTime);
//
// previousAvgCOM = avgCOMWorldSpace;
// // CoM /= c;
//
if (showBPPosRelToBody)
{
var pos = body_T.position;
Matrix4x4 bodyMatrix = body_T.localToWorldMatrix;
// get position from the last column
var bodyPos = new Vector3(bodyMatrix[0,3], bodyMatrix[1,3], bodyMatrix[2,3]);
Debug.DrawRay(bodyPos, Vector3.up, Color.yellow,Time.fixedDeltaTime);
foreach (var rb in rbList)
{
if (showRBPos)
{
Debug.DrawRay(rb.position, Vector3.up, Color.green,Time.fixedDeltaTime);
}
if (rb.transform != body_T)
{
if (showRelPosVectorOnly)
{
var relPosVector = rb.position - body_T.position;
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
Debug.DrawRay(body_T.position + relPosVector, Vector3.up, Color.red,Time.fixedDeltaTime);
// Vector3 currentLocalPosRelToMatrix = bodyMatrix.inverse.MultiplyPoint(rb.position);
Vector3 currentLocalPosRelToMatrix = bodyMatrix.inverse.MultiplyVector(rb.position - bodyPos);
Debug.DrawRay(body_T.position + currentLocalPosRelToMatrix, Vector3.up, Color.green,Time.fixedDeltaTime);
}
if (showInverseTransformPointUnscaledRelToBody)
{
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformPointUnscaled(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
//disabled this
// Debug.DrawRay(body_T.position + body_T.InverseTransformPointUnscaled(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
}
if (showInverseTransformPointRelToBody)
{
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
}
if (showInverseTransformDirRelToBody)
{
Debug.DrawRay(body_T.InverseTransformDirection(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
}
if (showInverseTransformVectorRelToBody)
{
Debug.DrawRay(body_T.position + body_T.InverseTransformVector(rb.position - body_T.position), Vector3.up, Color.red,Time.fixedDeltaTime);
}
// var localPosRelToBody = body.InverseTransformPoint(rb.position);
// Debug.DrawRay(body_T.position + body_T.InverseTransformPoint(rb.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + rb.transform.TransformVector(rb.transform.localPosition), Vector3.up, Color.cyan,Time.fixedDeltaTime);
// Debug.DrawRay(rb.transform.TransformPoint(rb.position), Vector3.up, Color.green,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformVector(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.InverseTransformDirection(rb.transform.position), Vector3.up, Color.red,Time.fixedDeltaTime);
// Debug.DrawRay(body_T.position + body_T.TransformPoint(rb.transform.localPosition), Vector3.up, Color.red,Time.fixedDeltaTime);
if (useTransformPoint)
{
}
else if (useTransformVector)
{
}
else if (useTransformDir)
{
}
}
}
}
}
}
// private void OnDrawGizmosSelected()
private void OnDrawGizmos()
{
if(!Application.isPlaying)
{
if (showCOMGizmos)
{
Vector3 CoM = Vector3.zero;
float c = 0f;
// avgCOMWorldSpace = Vector3.zero;
//SHOW BODY PART GIZMOS
foreach(var item in rbList)
{
// if (item)
// {
Gizmos.color = bodyPartCOMColor;
float drawCOMRadius = item.mass/totalMass;
Gizmos.DrawSphere(item.worldCenterOfMass, drawCOMRadius);
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
CoM += item.worldCenterOfMass * item.mass;
c += item.mass;
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
}
//DRAW AVG GIZMOS
avgCOMWorldSpace = CoM/c;
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
float avgCOMRadius = 0.5f; //radius of gizmo
Gizmos.color = avgCOMColor;
Gizmos.DrawSphere(avgCOMWorldSpace, avgCOMRadius);
}
}
else
{
if (showCOMGizmos)
{
// avgCOMWorldSpace = Vector3.zero;
//SHOW BODY PART GIZMOS
foreach(var item in rbList)
{
// if (item)
// {
Gizmos.color = bodyPartCOMColor;
float drawCOMRadius = item.mass/totalMass;
Gizmos.DrawSphere(item.worldCenterOfMass, drawCOMRadius);
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
}
//DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
float avgCOMGizmoRadius = 0.5f; //radius of gizmo
Gizmos.color = avgCOMColor;
Gizmos.DrawSphere(avgCOMWorldSpace, avgCOMGizmoRadius);
}
}
}
// {
// if(!Application.isPlaying)
// {
// if (showCOMGizmos)
// {
// avgCOMWorldSpace = Vector3.zero;
// //SHOW BODY PART GIZMOS
// foreach(var item in rbList)
// {
// if (item)
// {
// Gizmos.color = bodyPartCOMColor;
// float drawCOMRadius = item.mass/totalMass;
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// float avgCOMRadius = 0.1f; //radius of gizmo
// Gizmos.color = avgCOMColor;
// Gizmos.DrawSphere(avgCOMWorldSpace, avgCOMRadius);
// }
// }
// else
// {
// if (showCOMGizmos)
// {
// // avgCOMWorldSpace = Vector3.zero;
// //SHOW BODY PART GIZMOS
// foreach(var item in rbList)
// {
// if (item)
// {
// Gizmos.color = bodyPartCOMColor;
// float drawCOMRadius = item.mass/totalMass;
// Gizmos.DrawWireSphere(item.worldCenterOfMass, drawCOMRadius);
// // avgCOMWorldSpace += item.worldCenterOfMass;
// }
// }
// //DRAW AVG GIZMOS
// // avgCOMWorldSpace /= rbList.Count; //divide by num of rb's to get avg in WORLD space
// float avgCOMGizmoRadius = 0.1f; //radius of gizmo
// Gizmos.color = avgCOMColor;
// Gizmos.DrawSphere(avgCOMWorldSpace, avgCOMGizmoRadius);
// }
// }
// }
}

11
Project/Assets/ML-Agents/Examples/Walker/Scripts/AvgCenterOfMass.cs.meta


fileFormatVersion: 2
guid: 74cc05b039aa04d3da17ac9921123c22
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud.meta


fileFormatVersion: 2
guid: 8d773733493b846e9ac5f499b49ee72c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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

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


fileFormatVersion: 2
guid: 6fa638926d5204c779388e48e6255ad8
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/20kDistToTargCloud/WalkerDynamicVariableSpeed.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerDynamicVariableSpeed.nn.meta


fileFormatVersion: 2
guid: db7b60f9ef4594117b8c652234fee72d
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/20kDistToTargCloud/WalkerStatic.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerStatic.nn.meta


fileFormatVersion: 2
guid: 48d9838ba2af64512a599f6cecee6ce9
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/20kDistToTargCloud/WalkerStaticVariableSpeed.nn
文件差异内容过多而无法显示
查看文件

11
Project/Assets/ML-Agents/Examples/Walker/TFModels/20kDistToTargCloud/WalkerStaticVariableSpeed.nn.meta


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