public void TestStackingSensorBuiltInSensorType() { var dummySensor = new Dummy3DSensor(); dummySensor.ObservationSpec = ObservationSpec.Visual(2, 2, 4); dummySensor.Mapping = new[] { 0, 1, 2, 3 }; var stackedDummySensor = new StackingSensor(dummySensor, 2); Assert.AreEqual(stackedDummySensor.GetBuiltInSensorType(), BuiltInSensorType.Unknown); var vectorSensor = new VectorSensor(4); var stackedVectorSensor = new StackingSensor(vectorSensor, 4); Assert.AreEqual(stackedVectorSensor.GetBuiltInSensorType(), BuiltInSensorType.VectorSensor); }
public void TestBuiltInSensorType() { // Unknown { var sensor = new TestSensor("test"); Assert.AreEqual(sensor.GetBuiltInSensorType(), BuiltInSensorType.Unknown); var stackingSensor = new StackingSensor(sensor, 2); Assert.AreEqual(BuiltInSensorType.Unknown, stackingSensor.GetBuiltInSensorType()); } // Vector { var sensor = new VectorSensor(6); Assert.AreEqual(BuiltInSensorType.VectorSensor, sensor.GetBuiltInSensorType()); var stackingSensor = new StackingSensor(sensor, 2); Assert.AreEqual(BuiltInSensorType.VectorSensor, stackingSensor.GetBuiltInSensorType()); } var gameObject = new GameObject(); // Ray { var sensorComponent = gameObject.AddComponent <RayPerceptionSensorComponent3D>(); sensorComponent.DetectableTags = new List <string>(); var sensor = sensorComponent.CreateSensor(); Assert.AreEqual(BuiltInSensorType.RayPerceptionSensor, sensor.GetBuiltInSensorType()); var stackingSensor = new StackingSensor(sensor, 2); Assert.AreEqual(BuiltInSensorType.RayPerceptionSensor, stackingSensor.GetBuiltInSensorType()); } // Camera { var sensorComponent = gameObject.AddComponent <CameraSensorComponent>(); var sensor = sensorComponent.CreateSensor(); Assert.AreEqual(BuiltInSensorType.CameraSensor, sensor.GetBuiltInSensorType()); } // RenderTexture { var sensorComponent = gameObject.AddComponent <RenderTextureSensorComponent>(); var sensor = sensorComponent.CreateSensor(); Assert.AreEqual(BuiltInSensorType.RenderTextureSensor, sensor.GetBuiltInSensorType()); } }