Package ch.hevs.kart

Interface KartListener


public interface KartListener
  • Method Details

    • steeringPositionChanged

      default void steeringPositionChanged(@NonNull Kart kart, int position)

      Called by the kart whenever the actual steering position has changed. This is the absolute version where the position is the actual steps.

      This method is part of the KartListener interface and all listeners get notified when the value of the actual steering position has changed.

      Parameters:
      kart - The kart object.
      position - The actual position from 0 to max steps (depends kart mechanical design).
    • steeringPositionChangedNormalized

      default void steeringPositionChangedNormalized(@NonNull Kart kart, double position)

      Called by the kart whenever the actual steering position has changed. This is the normalized version where the position is between -1 and 1.

      This method is part of the KartListener interface and all listeners get notified when the value of the actual steering position has changed.

      Parameters:
      kart - The kart object.
      position - The actual position from -1 to 1.
    • steeringTargetPositionReachedChanged

      default void steeringTargetPositionReachedChanged(@NonNull Kart kart, boolean reached)

      The steering system has changed its state.

      This method is called when either the steering position has just reached its end position (reached = true) or when the steering system has got a new target value and starts the move to this new position (reached = false).

      Parameters:
      kart - The kart object.
      reached - True if the steering target position has reached, false otherwise.
    • batteryVoltageChanged

      default void batteryVoltageChanged(@NonNull Kart kart, double voltage)

      The battery voltage has changed.

      This method is called by the kart object whenever the battery voltage on the kart changes.

      Parameters:
      kart - The kart object.
      voltage - The battery voltage in volts [V].
    • batteryLevelChanged

      default void batteryLevelChanged(@NonNull Kart kart, double level)

      The battery level has changed.

      This method is called by the kart object whenever the battery level on the kart changes.

      Parameters:
      kart - The kart object.
      level - The battery level from 0 (empty) to 1 (full).
    • ultrasonicRangerDistanceChanged

      default void ultrasonicRangerDistanceChanged(@NonNull Kart kart, double distance)

      The distance measured by the ultrasonic ranger has changed.

      Parameters:
      kart - The kart object.
      distance - The distance in meters.
    • hallSensorCountChanged

      default void hallSensorCountChanged(@NonNull Kart kart, int index, int value)

      One hall pulse count has changed.

      This method is called by the kart object whenever one of the hall pulse counters has changed.

      Parameters:
      kart - The kart object.
      index - Index of the hall counter that changed.
      value - Count of pulses of the hall sensor.
    • currentChanged

      default void currentChanged(@NonNull Kart kart, double current)

      Current has changed.

      This method is called by the kart object whenever the current consumption on the kart changes.

      Note that not all Kart models do support this functionality. In that case the method will never be called.

      Parameters:
      kart - The kart object.
      current - The current in amperes [A].
    • digitalInputChanged

      default void digitalInputChanged(@NonNull Kart kart, int index, boolean value)

      A digital input has changed.

      This method is called by the kart object whenever the a digital input changes its value.

      Note that not all Kart models do support this functionality. In that case the method will never be called.

      Parameters:
      kart - The kart object.
      index - Index of the digital input that has changed.
      value - Value of the digital input.
    • connectionStatusChanged

      default void connectionStatusChanged(@NonNull Kart kart, boolean online)

      The connection status to the Kart has changed.

      This method is called if the Bluetooth connection to the kart has been closed or is broken.

      Parameters:
      kart - The kart object.
      online - True if the kart is online, false otherwise.
    • kartInitializationChanged

      default void kartInitializationChanged(@NonNull Kart kart, boolean initializing)

      The initialization status to the Kart has changed.

      This method is called if the state of the Kart initialization procedure has changed.

      Parameters:
      kart - The kart object.
      initializing - True if the kart is initializing, false otherwise.
    • statusRegisterChanged

      default void statusRegisterChanged(@NonNull Kart kart, int address, int newValue)

      This method is called by a Kart instance to which this listener has been registered for every register that changed it's value.

      Parameters:
      kart - The Kart instance holding the register that has changed.
      address - Address of the register that has changed.
      newValue - The new value of the register.
    • message

      default void message(@NonNull Kart kart, String message)

      The kart has a message to display, most of the time this are cryptic messages just for developers, but they might be helpful to display during development...

      Parameters:
      kart - The kart object.
      message - The message.