浏览代码

added trained model, renamed scene, usecollisioncallbacks

/docs-update
Hunter-Unity 5 年前
当前提交
6f91aeae
共有 9 个文件被更改,包括 2028 次插入2005 次删除
  1. 9
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ProjectSettingsOverrides.cs
  2. 999
      Project/Assets/ML-Agents/Examples/Walker/Prefabs/WalkerPairDynamic.prefab
  3. 9
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgentDynamic.cs
  4. 2
      Project/ProjectSettings/TimeManager.asset
  5. 1001
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerStaticNewRagdoll.unity
  6. 1001
      Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerSpeedClamp3.nn
  7. 11
      Project/Assets/ML-Agents/Examples/Walker/TFModels/WalkerSpeedClamp3.nn.meta
  8. 1001
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamic.unity
  9. 0
      /Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerStaticNewRagdoll.unity.meta

9
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ProjectSettingsOverrides.cs


float m_OriginalMaximumDeltaTime;
int m_OriginalSolverIterations;
int m_OriginalSolverVelocityIterations;
bool m_OriginalUseEnhancedDeterminism;
bool m_OriginalReuseCollisionCallbacks;
[Tooltip("Increase or decrease the scene gravity. Use ~3x to make things less floaty")]
public float gravityMultiplier = 1.0f;

public int solverIterations = 6;
[Tooltip("Affects how accurately the Rigidbody joints and collision contacts are resolved. (default 1). Must be positive.")]
public int solverVelocityIterations = 1;
// [Tooltip("Simulation in the scene is consistent regardless the actors present, provided that the game inserts the actors in a deterministic order.")]
// public bool useEnhancedDeterminism = false;
[Tooltip("Determines whether the garbage collector should reuse only a single instance of a Collision type for all collision callbacks. Reduces Garbage.")]
public bool reuseCollisionCallbacks = true;
public void Awake()
{

m_OriginalMaximumDeltaTime = Time.maximumDeltaTime;
m_OriginalSolverIterations = Physics.defaultSolverIterations;
m_OriginalSolverVelocityIterations = Physics.defaultSolverVelocityIterations;
m_OriginalReuseCollisionCallbacks = Physics.reuseCollisionCallbacks ;
// Override
Physics.gravity *= gravityMultiplier;

Physics.defaultSolverVelocityIterations = solverVelocityIterations;
Physics.reuseCollisionCallbacks = reuseCollisionCallbacks;
// Make sure the Academy singleton is initialized first, since it will create the SideChannels.
Academy.Instance.EnvironmentParameters.RegisterCallback("gravity", f => { Physics.gravity = new Vector3(0, -f, 0); });

Time.maximumDeltaTime = m_OriginalMaximumDeltaTime;
Physics.defaultSolverIterations = m_OriginalSolverIterations;
Physics.defaultSolverVelocityIterations = m_OriginalSolverVelocityIterations;
Physics.reuseCollisionCallbacks = m_OriginalReuseCollisionCallbacks;
}
}
}

999
Project/Assets/ML-Agents/Examples/Walker/Prefabs/WalkerPairDynamic.prefab
文件差异内容过多而无法显示
查看文件

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


void UpdateOrientationCube()
{
//FACING DIR
// m_WalkDir = target.position - m_OrientationCube.transform.position;
m_WalkDir = walkDirWorldspace;
m_WalkDir = target.position - m_OrientationCube.transform.position;
// m_WalkDir = walkDirWorldspace;
m_WalkDirLookRot = Quaternion.LookRotation(m_WalkDir);

void FixedUpdate()
{
// UpdateOrientationCube();
UpdateOrientationCube();
//reward looking at
// float facingReward = + 0.01f * Quaternion.Dot(m_OrientationCube.transform.rotation, hips.rotation)
// + 0.01f * Quaternion.Dot(m_OrientationCube.transform.rotation, head.rotation);

// + 0.02f * Vector3.Dot(m_OrientationCube.transform.forward,Vector3.ClampMagnitude(m_JdController.bodyPartsDict[hips].rb.velocity,5))
+0.01f * Vector3.Dot(m_OrientationCube.transform.forward,
Vector3.ClampMagnitude(m_JdController.bodyPartsDict[hips].rb.velocity, 3))
+ 0.01f * Vector3.Dot(m_OrientationCube.transform.forward, hips.forward)
+ 0.01f * Vector3.Dot(m_OrientationCube.transform.forward, hips.forward)
// + 0.01f * Quaternion.Dot(m_OrientationCube.transform.rotation, chest.rotation) //reward looking at

// transform.rotation = Quaternion.LookRotation(m_WalkDir);
// }
transform.rotation = Quaternion.Euler(0, Random.Range(0.0f, 360.0f), 0);
// UpdateOrientationCube();
UpdateOrientationCube();
// transform.Rotate(Vector3.up, Random.Range(0.0f, 360.0f));

2
Project/ProjectSettings/TimeManager.asset


m_ObjectHideFlags: 0
Fixed Timestep: 0.02
Maximum Allowed Timestep: 0.33333334
m_TimeScale: 15
m_TimeScale: 1
Maximum Particle Timestep: 0.03

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

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

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


fileFormatVersion: 2
guid: 8b4174e75a11c4f0eb5958c04eeab1d1
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/Scenes/WalkerDynamic.unity
文件差异内容过多而无法显示
查看文件

/Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamic.unity.meta → /Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerStaticNewRagdoll.unity.meta

正在加载...
取消
保存