Skip to content

Commit

Permalink
API additions, license year ++
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohsen Kamalzadeh committed Jan 26, 2021
1 parent 719bb9c commit 0bf436f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
com.unity.perception copyright © 2020 Unity Technologies ApS
com.unity.perception copyright © 2021 Unity Technologies ApS

Apache License
Version 2.0, January 2004
Expand Down
9 changes: 6 additions & 3 deletions com.unity.perception/Runtime/GroundTruth/DatasetCapture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public static EgoHandle RegisterEgo(string description)
/// <param name="modality">The kind of the sensor (ex. "camera", "lidar")</param>
/// <param name="description">A human-readable description of the sensor (ex. "front-left rgb camera")</param>
/// <param name="firstCaptureFrame">The time, in seconds, from the start of the sequence on which this sensor should first be scheduled.</param>
/// <param name="captureTriggerMode"></param>
/// <param name="simulationDeltaTime"></param>
/// <param name="framesBetweenCaptures"></param>
/// <param name="captureTriggerMode">The method of triggering captures for this sensor.</param>
/// <param name="simulationDeltaTime">The simulation frame time (seconds) requested by this sensor.</param>
/// <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>
/// <param name="manualSensorAffectSimulationTiming"></param>
/// <returns>A <see cref="SensorHandle"/>, which should be used to check <see cref="SensorHandle.ShouldCaptureThisFrame"/> each frame to determine whether to capture (or render) that frame.
/// It is also used to report captures, annotations, and metrics on the sensor.</returns>
Expand Down Expand Up @@ -293,6 +293,9 @@ public void ReportCapture(string filename, SensorSpatialData sensorSpatialData,
/// </summary>
public bool ShouldCaptureThisFrame => DatasetCapture.SimulationState.ShouldCaptureThisFrame(this);

/// <summary>
/// Requests a capture from this sensor on the next rendered frame. Can only be used with manual capture mode (<see cref="PerceptionCamera.CaptureTriggerMode.Manual"/>).
/// </summary>
public void CaptureOnNextUpdate()
{
DatasetCapture.SimulationState.SetNextCaptureTimeToNowForSensor(this);
Expand Down
15 changes: 12 additions & 3 deletions com.unity.perception/Runtime/GroundTruth/PerceptionCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,24 @@ public partial class PerceptionCamera : MonoBehaviour
public int firstCaptureFrame = 0;

/// <summary>
/// The method of triggering captures for this camera. In <see cref="PerceptionCamera.CaptureTriggerMode.Scheduled"/> mode, captures happen automatically based on a start time/frame and time/frame interval. In <see cref="PerceptionCamera.CaptureTriggerMode.Scheduled"/> mode, captures should be triggered manually through calling the <see cref="PerceptionCamera.CaptureOnNextUpdate"/> method of <see cref="PerceptionCamera"/>."
/// Capture trigger modes for <see cref="PerceptionCamera"/>.
/// </summary>
public enum CaptureTriggerMode
{
/// <summary>
/// Captures happen automatically based on a start frame and frame delta time.
/// </summary>
Scheduled,
/// <summary>
/// Captures should be triggered manually through calling the <see cref="PerceptionCamera.CaptureOnNextUpdate"/> method of <see cref="PerceptionCamera"/>.
/// </summary>
Manual
}
public CaptureTriggerMode captureTriggerMode = CaptureTriggerMode.Scheduled;

/// <summary>
/// The method of triggering captures for this camera.
/// </summary>
public CaptureTriggerMode captureTriggerMode = CaptureTriggerMode.Scheduled;

/// <summary>
/// Have this unscheduled (manual capture) camera affect simulation timings (similar to a scheduled camera) by requesting a specific frame delta time
Expand All @@ -70,7 +79,7 @@ public enum CaptureTriggerMode
public float simulationDeltaTime = 0.0166f;

/// <summary>
/// "The number of frames to simulate and render between the camera's scheduled captures. Setting this to 0 makes the camera capture frame.
/// The number of frames to simulate and render between the camera's scheduled captures. Setting this to 0 makes the camera capture every frame.
/// </summary>
public int framesBetweenCaptures = 0;

Expand Down

0 comments on commit 0bf436f

Please sign in to comment.