浏览代码

clean up

/docs-update
Hunter-Unity 4 年前
当前提交
89e95781
共有 2 个文件被更改,包括 7 次插入10 次删除
  1. 3
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ProjectSettingsOverrides.cs
  2. 14
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgentDynamic.cs

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


public class ProjectSettingsOverrides : MonoBehaviour
{
// Original values
Vector3 m_OriginalGravity;
float m_OriginalFixedDeltaTime;
float m_OriginalMaximumDeltaTime;

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;

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


[Space(10)]
[Header("Specific to Walker")]
public float maximumWalkingSpeed = 999; //The max walk velocity magnitude an agent will be rewarded for
Vector3 m_WalkDir;
Quaternion m_WalkDirLookRot;
[Space(10)]
public bool showOrientationCubeGizmo = true;
Vector3 m_WalkDir;
Quaternion m_WalkDirLookRot;
[Header("Target To Walk Towards")]
[Space(10)]

sensor.AddObservation(m_OrientationCube.transform.InverseTransformDirection(bp.rb.velocity));
sensor.AddObservation(m_OrientationCube.transform.InverseTransformDirection(bp.rb.angularVelocity));
sensor.AddObservation(m_OrientationCube.transform.InverseTransformDirection(bp.rb.position - hips.position)); //best
//Get position relative to hips in the context of our orientation cube's space
sensor.AddObservation(m_OrientationCube.transform.InverseTransformPoint(bp.rb.position)); //best
// sensor.AddObservation(m_OrientationCube.transform.InverseTransformDirection(bp.rb.position - hips.position)); //best
if (bp.rb.transform != hips && bp.rb.transform != handL && bp.rb.transform != handR)
{

{
m_ChestRb.mass = m_ResetParams.GetWithDefault("chest_mass", 8);
m_SpineRb.mass = m_ResetParams.GetWithDefault("spine_mass", 10);
// m_HipsRb.mass = m_ResetParams.GetWithDefault("hip_mass", 12);
m_HipsRb.mass = m_ResetParams.GetWithDefault("hip_mass", 15);
}

private void OnDrawGizmosSelected()
{
if (showOrientationCubeGizmo && Application.isPlaying)
if (Application.isPlaying)
{
Gizmos.color = Color.green;
Gizmos.matrix = m_OrientationCube.transform.localToWorldMatrix;

正在加载...
取消
保存