浏览代码

add a NaN debug for action values

/active-variablespeed
HH 4 年前
当前提交
281a4e60
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/JointDriveController.cs

12
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/JointDriveController.cs


/// </summary>
public void SetJointTargetRotation(float x, float y, float z)
{
if (float.IsNaN(x) || float.IsNaN(y) || float.IsNaN(z))
{
Debug.LogError($"Joint_NaN on {rb.name}: x:{x}, y:{y}, z:{z}, FrameCount:{Time.frameCount}");
// return;
}
else
{
Debug.Log($"Action on {rb.name}: x:{x}, y:{y}, z:{z}, FrameCount:{Time.frameCount}");
}
var xRot = Mathf.Lerp(joint.lowAngularXLimit.limit, joint.highAngularXLimit.limit, x);
var yRot = Mathf.Lerp(-joint.angularYLimit.limit, joint.angularYLimit.limit, y);

正在加载...
取消
保存