Class DistanceSensor

java.lang.Object
org.eclipse.mosaic.lib.objects.vehicle.sensor.DistanceSensor
All Implemented Interfaces:
Serializable

@Immutable public class DistanceSensor extends Object implements Serializable
This contains all information gathered by the vehicles distance sensor.
See Also:
  • Field Details

    • front

      public final SensorValue 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

      public final SensorValue 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

      public final SensorValue 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.
  • 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
      Parameters:
      front - see front
      back - see back
      left - see left
      right - see right
  • Method Details