/// <summary>
 /// Clean up the sensor created by CreateSensors().
 /// </summary>
 public void Dispose()
 {
     if (!ReferenceEquals(m_Sensor, null))
     {
         m_Sensor.Dispose();
         m_Sensor = null;
     }
 }
        /// <summary>
        /// Creates the <see cref="CameraSensor"/>
        /// </summary>
        /// <returns>The created <see cref="CameraSensor"/> object for this component.</returns>
        public override ISensor[] CreateSensors()
        {
            m_Sensor = new CameraSensor(m_Camera, m_Width, m_Height, Grayscale, m_SensorName, m_Compression, m_ObservationType);

            if (ObservationStacks != 1)
            {
                return(new ISensor[] { new StackingSensor(m_Sensor, ObservationStacks) });
            }
            return(new ISensor[] { m_Sensor });
        }
Example #3
0
        /// <summary>
        /// Creates the <see cref="CameraSensor"/>
        /// </summary>
        /// <returns>The created <see cref="CameraSensor"/> object for this component.</returns>
        public override ISensor CreateSensor()
        {
            m_Sensor = new CameraSensor(m_Camera, m_Width, m_Height, Grayscale, m_SensorName, m_Compression);

            if (ObservationStacks != 1)
            {
                return(new StackingSensor(m_Sensor, ObservationStacks));
            }
            return(m_Sensor);
        }
Example #4
0
        /// <summary>
        /// Computes the observation shape of the sensor.
        /// </summary>
        /// <returns>The observation shape of the associated <see cref="CameraSensor"/> object.</returns>
        public override int[] GetObservationShape()
        {
            var stacks            = ObservationStacks > 1 ? ObservationStacks : 1;
            var cameraSensorshape = CameraSensor.GenerateShape(m_Width, m_Height, Grayscale);

            if (stacks > 1)
            {
                cameraSensorshape[cameraSensorshape.Length - 1] *= stacks;
            }
            return(cameraSensorshape);
        }
 /// <summary>
 /// Creates the <see cref="CameraSensor"/>
 /// </summary>
 /// <returns>The created <see cref="CameraSensor"/> object for this component.</returns>
 public override ISensor CreateSensor()
 {
     m_Sensor = new CameraSensor(m_Camera, m_Width, m_Height, Grayscale, m_SensorName, m_Compression);
     return(m_Sensor);
 }
 /// <summary>
 /// Computes the observation shape of the sensor.
 /// </summary>
 /// <returns>The observation shape of the associated <see cref="CameraSensor"/> object.</returns>
 public override int[] GetObservationShape()
 {
     return(CameraSensor.GenerateShape(m_Width, m_Height, Grayscale));
 }