浏览代码

max dist 50 avg core vel

/active-variablespeed
HH 4 年前
当前提交
c34ea517
共有 3 个文件被更改,包括 82 次插入18 次删除
  1. 12
      Project/Assets/ML-Agents/Examples/Walker/Prefabs/Ragdoll/WalkerRagdollBase.prefab
  2. 50
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamicVariableSpeed.unity
  3. 38
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs

12
Project/Assets/ML-Agents/Examples/Walker/Prefabs/Ragdoll/WalkerRagdollBase.prefab


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

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

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

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

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

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

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


propertyPath: m_ConnectedAnchor.y
value: 0.5119997
objectReference: {fileID: 0}
- target: {fileID: 662251329593801119, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: rotTest
value:
objectReference: {fileID: 1359243705}
- target: {fileID: 933197474575860254, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive

value:
objectReference: {fileID: 11400000, guid: db7b60f9ef4594117b8c652234fee72d,
type: 3}
- target: {fileID: 7955124901054842523, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7955124901202383237, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7955124901413706531, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7955124901560913141, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7955124902018956043, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7955124902089967439, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7955124902091965564, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7955124902211329727, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7955124902293757612, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7964409123409882683, guid: 4ee4867f326424260aa2753712f3d643,
type: 3}
propertyPath: m_ConnectedAnchor.y

38
Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs


}
}
public Transform rotTest;
/// <summary>
/// Loop over body parts to add them to observation.
/// </summary>

//current speed goal. normalized.
sensor.AddObservation(walkingSpeed / m_maxWalkingSpeed);
//rotation deltas
//Dist To Target Normalized to 100 meters;
//Dist To Target. Max 50 meters. Normalized;
? (target.position - hips.position).magnitude/100
? Mathf.Clamp((target.position - hips.position).magnitude, 0, 50)/50
: 1;
sensor.AddObservation(distToTarget);

{
Vector3 velSum = Vector3.zero;
Vector3 avgVel = Vector3.zero;
//ALL RBS
int numOfRB = 0;
foreach (var item in m_JdController.bodyPartsList)
{
numOfRB++;
velSum += item.rb.velocity;
}
avgVel = velSum / numOfRB;
velSum += m_JdController.bodyPartsDict[head].rb.velocity;
velSum += m_JdController.bodyPartsDict[chest].rb.velocity;
velSum += m_JdController.bodyPartsDict[spine].rb.velocity;
velSum += m_JdController.bodyPartsDict[hips].rb.velocity;
avgVel = velSum / 4;
// Vector3 GetAvgVelocity()
// {
// Vector3 velSum = Vector3.zero;
// Vector3 avgVel = Vector3.zero;
//
// //ALL RBS
// int numOfRB = 0;
// foreach (var item in m_JdController.bodyPartsList)
// {
// numOfRB++;
// velSum += item.rb.velocity;
// }
//
// avgVel = velSum / numOfRB;
// return avgVel;
// }
// public float headHeightOverFeetReward; //reward for standing up straight-ish
public RewardManager rewardManager;

正在加载...
取消
保存