Example #1
0
        /// <summary>
        /// Register a new ego. Used along with RegisterSensor to organize sensors under a top-level ego container. <seealso cref="RegisterSensor"/>
        /// </summary>
        /// <param name="description">A human-readable description for the ego</param>
        /// <returns>An <see cref="EgoHandle"/>, which can be used to organize sensors under a common ego.</returns>
        public static EgoHandle RegisterEgo(string description)
        {
            var ego = new EgoHandle(Guid.NewGuid(), description);

            SimulationState.AddEgo(ego);
            return(ego);
        }
Example #2
0
 void EnsureEgoInitialized()
 {
     if (m_EgoHandle == default)
     {
         m_EgoHandle = SimulationManager.RegisterEgo(Description);
     }
 }
Example #3
0
 void EnsureEgoInitialized()
 {
     if (m_EgoHandle == default)
     {
         m_EgoHandle = DatasetCapture.RegisterEgo(Description);
     }
 }
Example #4
0
        /// <summary>
        /// Register a new sensor under the given ego.
        /// </summary>
        /// <param name="egoHandle">The ego container for the sensor. Sensor orientation will be reported in the context of the given ego.</param>
        /// <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 offset from the current frame on which this sensor should first be scheduled.</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">Have this unscheduled (manual capture) camera affect simulation timings (similar to a scheduled camera) by requesting a specific frame delta time</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>
        /// <exception cref="ArgumentException">Thrown if ego is invalid.</exception>
        public static SensorHandle RegisterSensor(EgoHandle egoHandle, string modality, string description, float firstCaptureFrame, CaptureTriggerMode captureTriggerMode, float simulationDeltaTime, int framesBetweenCaptures, bool manualSensorAffectSimulationTiming = false)
        {
            if (!SimulationState.Contains(egoHandle.Id))
            {
                throw new ArgumentException("Supplied ego is not part of the simulation.", nameof(egoHandle));
            }

            var sensor = new SensorHandle(Guid.NewGuid());

            SimulationState.AddSensor(egoHandle, modality, description, firstCaptureFrame, captureTriggerMode, simulationDeltaTime, framesBetweenCaptures, manualSensorAffectSimulationTiming, sensor);
            return(sensor);
        }
Example #5
0
        /// <summary>
        /// Register a new sensor under the given ego.
        /// </summary>
        /// <param name="egoHandle">The ego container for the sensor. Sensor orientation will be reported in the context of the given ego.</param>
        /// <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="period">The period, in seconds, on which the sensor should capture. Frames will be scheduled in the simulation such that each sensor is triggered every _period_ seconds.</param>
        /// <param name="firstCaptureTime">The time, in seconds, from the start of the sequence on which this sensor should first be scheduled.</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>
        /// <exception cref="ArgumentException">Thrown if ego is invalid.</exception>
        public static SensorHandle RegisterSensor(EgoHandle egoHandle, string modality, string description, float period, float firstCaptureTime)
        {
            if (!SimulationState.Contains(egoHandle.Id))
            {
                throw new ArgumentException("Supplied ego is not part of the simulation.", nameof(egoHandle));
            }

            var sensor = new SensorHandle(Guid.NewGuid());

            SimulationState.AddSensor(egoHandle, modality, description, period, firstCaptureTime, sensor);
            return(sensor);
        }