Package org.opentcs.drivers.vehicle
Interface VehicleController
- All Superinterfaces:
Lifecycle
,Scheduler.Client
public interface VehicleController extends Lifecycle, Scheduler.Client
Provides high-level methods for the system to control a vehicle.
-
Method Summary
Modifier and Type Method Description void
abortDriveOrder()
Notifies the controller that the current drive order is to be aborted.ExplainedBoolean
canProcess(java.util.List<java.lang.String> operations)
Checks if the vehicle would be able to process the given sequence of operations, taking into account its current state.void
clearCommandQueue()
Clears the associated vehicle's command queue and frees all resources reserved for the removed commands/movements.void
clearDriveOrder()
Resets the current drive order for the vehicle associated with this controller.java.util.Queue<MovementCommand>
getCommandsSent()
Returns a list ofMovementCommand
s that have been sent to the communication adapter.void
sendCommAdapterCommand(AdapterCommand command)
Sends aAdapterCommand
to the communication adapter.void
sendCommAdapterMessage(java.lang.Object message)
Delivers a generic message to the communication adapter.void
setDriveOrder(DriveOrder newOrder, java.util.Map<java.lang.String,java.lang.String> orderProperties)
Sets the current drive order for the vehicle associated with this controller.void
updateDriveOrder(DriveOrder newOrder, java.util.Map<java.lang.String,java.lang.String> orderProperties)
Updates the current drive order for the vehicle associated with this controller.Methods inherited from interface org.opentcs.components.Lifecycle
initialize, isInitialized, terminate
Methods inherited from interface org.opentcs.components.kernel.Scheduler.Client
allocationFailed, allocationSuccessful, getId
-
Method Details
-
setDriveOrder
void setDriveOrder(@Nonnull DriveOrder newOrder, @Nonnull java.util.Map<java.lang.String,java.lang.String> orderProperties) throws java.lang.IllegalStateExceptionSets the current drive order for the vehicle associated with this controller.- Parameters:
newOrder
- The new drive order.orderProperties
- Properties of the transport order the new drive order is part of.- Throws:
java.lang.IllegalStateException
- If this controller already has a drive order.
-
updateDriveOrder
void updateDriveOrder(@Nonnull DriveOrder newOrder, @Nonnull java.util.Map<java.lang.String,java.lang.String> orderProperties) throws java.lang.IllegalStateExceptionUpdates the current drive order for the vehicle associated with this controller.An update is only allowed, if the continuity of the current drive order is guaranteed. The continuity of the current drive order is guaranteed, if the routes of both the current drive order and the
newOrder
match to the point where the vehicle associated with this controller is currently reported at. Beyond that point the routes may diverge.- Parameters:
newOrder
- The new drive order.orderProperties
- Properties of the transport order the new drive order is part of.- Throws:
java.lang.IllegalStateException
- If thenewOrder
would not guarantee the current drive order's continuity.
-
clearDriveOrder
void clearDriveOrder()Resets the current drive order for the vehicle associated with this controller. -
abortDriveOrder
void abortDriveOrder()Notifies the controller that the current drive order is to be aborted. After receiving this notification, the controller should not send any further movement commands to the vehicle. -
clearCommandQueue
void clearCommandQueue()Clears the associated vehicle's command queue and frees all resources reserved for the removed commands/movements. -
canProcess
Checks if the vehicle would be able to process the given sequence of operations, taking into account its current state.- Parameters:
operations
- A sequence of operations that might appear in future commands.- Returns:
- A
Processability
telling if the vehicle would be able to process every single operation in the list (in the given order).
-
sendCommAdapterMessage
void sendCommAdapterMessage(@Nullable java.lang.Object message)Delivers a generic message to the communication adapter.- Parameters:
message
- The message to be delivered.
-
sendCommAdapterCommand
Sends aAdapterCommand
to the communication adapter.- Parameters:
command
- The adapter command to be sent.
-
getCommandsSent
Returns a list ofMovementCommand
s that have been sent to the communication adapter.- Returns:
- A list of
MovementCommand
s that have been sent to the communication adapter.
-