浏览代码

Merge branch 'RunSwimFlyRich-master' into develop

/develop-gpu-test
Arthur Juliani 5 年前
当前提交
fa46be7f
共有 7 个文件被更改,包括 835 次插入3181 次删除
  1. 10
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Brains/CrawlerDynamicLearning.asset
  2. 10
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Brains/CrawlerStaticLearning.asset
  3. 977
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Prefabs/DynamicPlatform.prefab
  4. 982
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Prefabs/FixedPlatform.prefab
  5. 35
      UnitySDK/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs
  6. 1001
      UnitySDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerDynamicLearning.nn
  7. 1001
      UnitySDK/Assets/ML-Agents/Examples/Crawler/TFModels/CrawlerStaticLearning.nn

10
UnitySDK/Assets/ML-Agents/Examples/Crawler/Brains/CrawlerDynamicLearning.asset


--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

brainParameters:
vectorObservationSize: 129
vectorObservationSize: 126
numStackedVectorObservations: 1
vectorActionSize: 14000000
cameraResolutions: []

-
-
vectorActionSpaceType: 1
model: {fileID: 11400000, guid: 94d1889cee00f4361b74cbc4eb129f11, type: 3}
model: {fileID: 5022602860645237092, guid: 94d1889cee00f4361b74cbc4eb129f11, type: 3}
inferenceDevice: 0

10
UnitySDK/Assets/ML-Agents/Examples/Crawler/Brains/CrawlerStaticLearning.asset


--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0

brainParameters:
vectorObservationSize: 129
vectorObservationSize: 126
numStackedVectorObservations: 1
vectorActionSize: 14000000
cameraResolutions: []

-
-
vectorActionSpaceType: 1
model: {fileID: 11400000, guid: 9dbf8cc316ac9410b961ed268824778f, type: 3}
model: {fileID: 5022602860645237092, guid: 9dbf8cc316ac9410b961ed268824778f, type: 3}
inferenceDevice: 0

977
UnitySDK/Assets/ML-Agents/Examples/Crawler/Prefabs/DynamicPlatform.prefab
文件差异内容过多而无法显示
查看文件

982
UnitySDK/Assets/ML-Agents/Examples/Crawler/Prefabs/FixedPlatform.prefab
文件差异内容过多而无法显示
查看文件

35
UnitySDK/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs


bool isNewDecisionStep;
int currentDecisionStep;
Quaternion lookRotation;
Matrix4x4 targetDirMatrix;
public override void InitializeAgent()
{
jdController = GetComponent<JointDriveController>();

jdController.SetupBodyPart(leg2Lower);
jdController.SetupBodyPart(leg3Upper);
jdController.SetupBodyPart(leg3Lower);
}
}
/// <summary>
/// We only need to change the joint settings based on decision freq.

{
var rb = bp.rb;
AddVectorObs(bp.groundContact.touchingGround ? 1 : 0); // Whether the bp touching the ground
AddVectorObs(rb.velocity);
AddVectorObs(rb.angularVelocity);
Vector3 velocityRelativeToLookRotationToTarget = targetDirMatrix.inverse.MultiplyVector(rb.velocity);
AddVectorObs(velocityRelativeToLookRotationToTarget);
Vector3 angularVelocityRelativeToLookRotationToTarget = targetDirMatrix.inverse.MultiplyVector(rb.angularVelocity);
AddVectorObs(angularVelocityRelativeToLookRotationToTarget);
if (bp.rb.transform != body)
{

{
jdController.GetCurrentJointForces();
// Normalize dir vector to help generalize
AddVectorObs(dirToTarget.normalized);
lookRotation = Quaternion.LookRotation(dirToTarget);
targetDirMatrix = Matrix4x4.TRS(Vector3.zero, lookRotation, Vector3.one);
AddVectorObs(body.transform.position.y);
AddVectorObs(body.forward);
AddVectorObs(body.up);
RaycastHit hit;
if (Physics.Raycast(body.position, Vector3.down, out hit, 10.0f))
{
AddVectorObs(hit.distance);
}
else
AddVectorObs(10.0f);
Vector3 bodyForwardRelativeToLookRotationToTarget = targetDirMatrix.inverse.MultiplyVector(body.forward);
AddVectorObs(bodyForwardRelativeToLookRotationToTarget);
Vector3 bodyUpRelativeToLookRotationToTarget = targetDirMatrix.inverse.MultiplyVector(body.up);
AddVectorObs(bodyUpRelativeToLookRotationToTarget);
foreach (var bodyPart in jdController.bodyPartsDict.Values)
{
CollectObservationBodyPart(bodyPart);

{
transform.rotation = Quaternion.LookRotation(dirToTarget);
}
transform.Rotate(Vector3.up,Random.Range(0.0f, 360.0f));
foreach (var bodyPart in jdController.bodyPartsDict.Values)
{

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

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

正在加载...
取消
保存