浏览代码

properly setting up perception camera in scenario test

/usim-randomization
Steven Leal 4 年前
当前提交
b8daea68
共有 1 个文件被更改,包括 16 次插入3 次删除
  1. 19
      com.unity.perception/Tests/Runtime/Randomization/ScenarioTests.cs

19
com.unity.perception/Tests/Runtime/Randomization/ScenarioTests.cs


[UnityTest]
public IEnumerator StartNewDatasetSequenceEveryIteration()
{
var perceptionCamera = SetupPerceptionCamera();
var perceptionCamera = m_TestObject.AddComponent<PerceptionCamera>();
perceptionCamera.startTime = 0;
// Skip first frame
yield return new WaitForEndOfFrame();

// Third frame, second iteration, SequenceTime has been reset
yield return new WaitForEndOfFrame();
Assert.AreEqual(DatasetCapture.SimulationState.SequenceTime, 0);
}
PerceptionCamera SetupPerceptionCamera()
{
m_TestObject.SetActive(false);
var camera = m_TestObject.AddComponent<Camera>();
camera.orthographic = true;
camera.orthographicSize = 1;
var perceptionCamera = m_TestObject.AddComponent<PerceptionCamera>();
perceptionCamera.captureRgbImages = false;
m_TestObject.SetActive(true);
return perceptionCamera;
}
}
}
正在加载...
取消
保存