Schnittstelle VehicleController
- Alle Superschnittstellen:
Lifecycle
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
abortTransportOrder
(boolean immediate) Notifies the controller that the current transport order is to be aborted.canProcess
(TransportOrder order) Checks if the vehicle would be able to process the given transport order, taking into account its current state.Returns a list ofMovementCommand
s that have been sent to the communication adapter.Returns the command for which the execution of peripheral operations must be completed before it can be sent to the communication adapter.boolean
mayAllocateNow
(Set<TCSResource<?>> resources) Checks if the given set of resources are safe to be allocated immediately by this controller.void
onVehiclePaused
(boolean paused) Notifies the implementation that the vehicle's paused state in the kernel has changed.void
sendCommAdapterCommand
(AdapterCommand command) Sends aAdapterCommand
to the communication adapter.void
sendCommAdapterMessage
(Object message) Delivers a generic message to the communication adapter.void
setTransportOrder
(TransportOrder newOrder) Sets/Updates the current transport order for the vehicle associated with this controller.Von Schnittstelle geerbte Methoden org.opentcs.components.Lifecycle
initialize, isInitialized, terminate
-
Methodendetails
-
setTransportOrder
Sets/Updates the current transport order for the vehicle associated with this controller.The controller is expected to process the transport order's current drive order. Once processing of this drive order is finished, it sets the vehicle's processing state to
Vehicle.ProcState.AWAITING_ORDER
to signal this. This method will then be called for either the next drive order in the same transport order or a new transport order.This method may also be called again for the same/current drive order in case any future part of the route to be taken for the transport order has changed. In case of such an update, the continuity of the transport order's route is guaranteed, which means that the previously given route and the one given in
newOrder
match up to the last point already sent to the vehicle associated with this controller. Beyond that point the routes may diverge.- Parameter:
newOrder
- The new or updated transport order.- Löst aus:
IllegalArgumentException
- IfnewOrder
cannot be processed for some reason, e.g. because it has already been partly processed and the route's continuity is not given, the vehicle's current position is unknown or the resources for the vehicle's current position may not be allocated (in case of forced rerouting).
-
abortTransportOrder
void abortTransportOrder(boolean immediate) Notifies the controller that the current transport order is to be aborted. After receiving this notification, the controller should not send any further movement commands to the vehicle.- Parameter:
immediate
- Iftrue
, immediately reset the current transport order for the vehicle associated with this controller, clears the vehicle's command queue implicitly and frees all resources reserved for the removed commands/movements. (Note that this is unsafe, as the vehicle might be moving and clearing the command queue might overlap with the vehicle's movement/progress.)
-
canProcess
Checks if the vehicle would be able to process the given transport order, taking into account its current state.- Parameter:
order
- The transport order to be checked.- Gibt zurück:
- An
ExplainedBoolean
indicating whether the vehicle would be able to process given order.
-
onVehiclePaused
void onVehiclePaused(boolean paused) Notifies the implementation that the vehicle's paused state in the kernel has changed. If pausing between points in the plant model is supported by the vehicle, the communication adapter may want to inform the vehicle about this change of state.- Parameter:
paused
- The vehicle's new paused state.
-
sendCommAdapterMessage
Delivers a generic message to the communication adapter.- Parameter:
message
- The message to be delivered.
-
sendCommAdapterCommand
Sends aAdapterCommand
to the communication adapter.- Parameter:
command
- The adapter command to be sent.
-
getCommandsSent
Returns a list ofMovementCommand
s that have been sent to the communication adapter.- Gibt zurück:
- A list of
MovementCommand
s that have been sent to the communication adapter.
-
getInteractionsPendingCommand
Returns the command for which the execution of peripheral operations must be completed before it can be sent to the communication adapter. For this command, allocated resources have already been accepted.- Gibt zurück:
- The command for which the execution of peripheral operations is pending or
Optional.empty()
if there's no such command.
-
mayAllocateNow
Checks if the given set of resources are safe to be allocated immediately by this controller.- Parameter:
resources
- The requested resources.- Gibt zurück:
true
if the given resources are safe to be allocated by this controller, otherwisefalse
.
-