Skip to content

Commit 2dfdbff

Browse files
Fix for bug with frame timings.
1 parent 3ca8e97 commit 2dfdbff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

com.unity.perception/Runtime/GroundTruth/DatasetCapture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static EgoHandle RegisterEgo(string description)
4949
/// <param name="egoHandle">The ego container for the sensor. Sensor orientation will be reported in the context of the given ego.</param>
5050
/// <param name="modality">The kind of the sensor (ex. "camera", "lidar")</param>
5151
/// <param name="description">A human-readable description of the sensor (ex. "front-left rgb camera")</param>
52-
/// <param name="firstCaptureFrame">The time, in seconds, from the start of the sequence on which this sensor should first be scheduled.</param>
52+
/// <param name="firstCaptureFrame">The offset from the current frame on which this sensor should first be scheduled.</param>
5353
/// <param name="captureTriggerMode">The method of triggering captures for this sensor.</param>
5454
/// <param name="simulationDeltaTime">The simulation frame time (seconds) requested by this sensor.</param>
5555
/// <param name="framesBetweenCaptures">The number of frames to simulate and render between the camera's scheduled captures. Setting this to 0 makes the camera capture every frame.</param>

com.unity.perception/Runtime/GroundTruth/SimulationState.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public void AddSensor(EgoHandle egoHandle, string modality, string description,
373373
{
374374
modality = modality,
375375
description = description,
376-
firstCaptureTime = firstCaptureFrame * renderingDeltaTime,
376+
firstCaptureTime = UnscaledSequenceTime + firstCaptureFrame * renderingDeltaTime,
377377
captureTriggerMode = captureTriggerMode,
378378
renderingDeltaTime = renderingDeltaTime,
379379
framesBetweenCaptures = framesBetweenCaptures,
@@ -382,7 +382,7 @@ public void AddSensor(EgoHandle egoHandle, string modality, string description,
382382
lastCaptureFrameCount = -1
383383
};
384384
sensorData.sequenceTimeOfNextCapture = GetSequenceTimeOfNextCapture(sensorData);
385-
sensorData.sequenceTimeOfNextRender = 0;
385+
sensorData.sequenceTimeOfNextRender = UnscaledSequenceTime;
386386
m_ActiveSensors.Add(sensor);
387387
m_Sensors.Add(sensor, sensorData);
388388
m_Ids.Add(sensor.Id);

0 commit comments

Comments
 (0)