Class ClosestTargetProcessor

    • Constructor Detail

      • ClosestTargetProcessor

        public ClosestTargetProcessor​(int xCrosshairs,
                                      int yCrosshairs)
        Construct a new target processor with the given fixed crosshairs position.
        Parameters:
        xCrosshairs - X coordinate for the crosshairs
        yCrosshairs - Y coordinate for the crosshairs
      • ClosestTargetProcessor

        public ClosestTargetProcessor​(java.util.function.IntSupplier xCrosshairs,
                                      java.util.function.IntSupplier yCrosshairs)
        Construct a new target processor which reads crosshairs position from the given functions. The most common use case would be to pass IntPreference.get(). Whatever you pass must be safe to call from the vision thread, so it should not reference the internals of commands, subsystems, or other robot code. Note that preferences are safe to access from any thread.
        Parameters:
        xCrosshairs - X coordinate for the crosshairs
        yCrosshairs - Y coordinate for the crosshairs