Class DistanceSensor
java.lang.Object
org.eclipse.mosaic.lib.objects.vehicle.sensor.DistanceSensor
- All Implemented Interfaces:
Serializable
This contains all information gathered by the vehicles distance sensor.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal SensorValue
Distance to following vehicle in [m].final SensorValue
Distance to leading vehicle in [m].final SensorValue
Distance to vehicle to the left in [m].final SensorValue
Distance to vehicle to the right in [m]. -
Constructor Summary
ConstructorsConstructorDescriptionDistanceSensor
(double front, double back, double left, double right) This creates a new distance sensor object. -
Method Summary
-
Field Details
-
front
Distance to leading vehicle in [m]. Will be -1 when vehicle does not have this specific distance sensor. Will be Double.POSITIVE_INFINITY when no vehicle was detected. -
back
Distance to following vehicle in [m]. Will be -1 when vehicle does not have this specific distance sensor. Will be Double.POSITIVE_INFINITY when no vehicle was detected. -
left
Distance to vehicle to the left in [m]. Will be -1 when vehicle does not have this specific distance sensor. Will be Double.POSITIVE_INFINITY when no vehicle was detected. -
right
Distance to vehicle to the right in [m]. Will be -1 when vehicle does not have this specific distance sensor. Will be Double.POSITIVE_INFINITY when no vehicle was detected.
-
-
Constructor Details
-
DistanceSensor
public DistanceSensor(double front, double back, double left, double right) This creates a new distance sensor object. If the vehicle does not have specific sensors set the appropriate variables to -1. If no vehicle found in sensor range set to Double.POSITIVE_INFINITY
-
-
Method Details