Interface KartListener
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
batteryLevelChanged
(Kart kart, double level) The battery level has changed.default void
batteryVoltageChanged
(Kart kart, double voltage) The battery voltage has changed.default void
connectionStatusChanged
(Kart kart, boolean online) The connection status to the Kart has changed.default void
currentChanged
(Kart kart, double current) Current has changed.default void
digitalInputChanged
(Kart kart, int index, boolean value) A digital input has changed.default void
hallSensorCountChanged
(Kart kart, int index, int value) One hall pulse count has changed.default void
kartInitializationChanged
(Kart kart, boolean initializing) The initialization status to the Kart has changed.default void
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...default void
statusRegisterChanged
(Kart kart, int address, int newValue) This method is called by aKart
instance to which this listener has been registered for every register that changed it's value.default void
steeringPositionChanged
(Kart kart, int position) Called by the kart whenever the actual steering position has changed.default void
steeringPositionChangedNormalized
(Kart kart, double position) Called by the kart whenever the actual steering position has changed.default void
steeringTargetPositionReachedChanged
(Kart kart, boolean reached) The steering system has changed its state.default void
ultrasonicRangerDistanceChanged
(Kart kart, double distance) The distance measured by the ultrasonic ranger has changed.
-
Method Details
-
steeringPositionChanged
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
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
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
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
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
The distance measured by the ultrasonic ranger has changed.
- Parameters:
kart
- The kart object.distance
- The distance in meters.
-
hallSensorCountChanged
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
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
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
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
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
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
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.
-