An AGV adapter that implements a virtual AGV supporting free autonomous navigation along edges, and a basic, yet extensible set of actions.

This adapter is meant to be used as a template for realizing your own adapter, for simulation purposes, integration testing, and in other kind of environments where real AGVs are not available or must be mocked.

The following actions are supported:

  • noop [instant, node, edge]
  • pick/drop [node],
  • initPosition [instant, node]
  • startPause/stopPause [instant]
  • startCharging/stopCharging [instant, node]
  • cancelOrder [instant, supported by AgvController]
  • stateRequest [instant, supported by AgvController]
  • factsheetRequest [instant, supported by AgvController]
  • orderExecutionTime [instant (custom)]

The actions noop, pick, drop, startCharging, and stopCharging accept an optional action parameter named "duration" that specifies the number of seconds to stay in action state RUNNING. If not specified all these actions stay running for 5 seconds. Note that pick and drop actions stay in status INITIALIZING for 1 additional second.

Remarks

To be executable by the virtual AGV an order must specify nodePosition for all nodes except for the first one as VDA 5050 requires the vehicle to be already positioned on the first node (within a given deviation range). The property nodeId alone is not usable as a symbolic position.

By default, when the virtual AGV is started, it is positioned at { x: 0, y: 0, theta: 0, lastNodeId: "0" } relative to a map with mapId local. You can override this pose by supplying the option VirtualAgvAdapterOptions.initialPosition when instantiating the virtual AGV. In addition, you can override or reset this pose using the instant or node action initPosition, specifying x, y, theta, mapId, lastNodeId, and lastNodeSequenceId (optional, defaults to zero) as action parameters.

The virtual AGV provides a constant safety state where no e-stop is activated and where the protective field is never violated. The operating mode of the virtual AGV is always automatic, i.e. it is fully controlled by master control.

The virtual AGV can only pick and carry one load at a time. Before picking another load the current load must have been dropped.

A charging action is executed on a charging spot while the vehicle is standing, either as an instant action or as a node action. Charging mode is either terminated explicitely by action stopCharging or automatically when the battery is fully charged.

The AGV's remaining battery reach is reported in the State.batteryState property unless the vehicle time distribution mode is active according to the option vehicleTimeDistribution. When the AGV's battery runs low according to the option lowBatteryChargeThreshold it stops driving and reports an error of type "batteryLowError". The master control must then initiate further actions, e.g. cancel any active order or start charging. The battery low error is removed from State as soon as battery charge advances 10% above the configured threshold.

The custom action orderExecutionTime expects an action parameter key orders with an array of VDA 5050 headerless Order objects as parameter value. The action finishes immediately reporting the estimated order execution times in seconds as values in a comma-separated string format via the resultDescription of the corresponding action state. The calculated estimates include the effective duration of action processing on the order's nodes (taking action blocking types and concurrent actions into account) as well as the travel time on the order's edges, including both base and horizon nodes and edges.

To support benchmarking and performance measurement based on statistics the virtual AGV also supports probabilistic distribution of driving speed or driving time by corresponding adapter options.

Hierarchy

  • VirtualAgvAdapter

Implements

Constructors

Properties

Accessors

  • get apiVersion(): number
  • Defines the protocol version number of this adapter, a positive integer.

    Increment this version whenever you make changes to the adapter protocol.

    Remarks

    The API version of this adapter must match (i.e. equal) the API version of the associated AGV controller. If both versions differ, an error is thrown when the adapter is instantiated.

    Returns number

Methods

  • Registers a handler that is invoked once by the associated controller when the adapter should perform initializations and connect to the AGV navigation & control interface.

    The handler function should compute initial vehicles states and report them back to the controller after initialization is complete through the callback AttachContext.attached. Until this callback is invoked, the controller won't invoke any of the other handler functions defined in this interface.

    Parameters

    Returns void

  • Determines whether the given order could be executed potentially by checking whether the order route is traversable and all node actions are potentially executable.

    Returns

    true if order can be executed potentially; false otherwise

    Parameters

    • nodes: Node[]

      nodes of order

    • edges: Edge[]

      edges of order

    Returns boolean

  • Registers a handler that is invoked by the associated controller whenever a not yet finished or failed node or edge action of an active order is to be canceled.

    If the action cannot be interrupted it should continue running until finished or failed. If the action can be interrupted it should be canceled and action status FAILED should be reported via context.updateActionStatus.

    Remarks

    This handler function is only invoked for node and edge actions previously scheduled by the executeAction handler and not yet finished or failed, i.e. for actions that are either in status INITIALIZING, RUNNING, or PAUSED.

    Parameters

    • context: ActionContext

      context information of a node or edge action to be canceled

    Returns void

  • Registers a handler that is invoked once by the associated controller when the adapter should perform deinitializations and disconnect from the AGV navigation & control interface.

    The handler function may compute final vehicles states and report them back to the controller after deinitialization is complete through the callback DetachContext.detached. After this callback is invoked, the controller won't invoke any of the other handler functions defined in this interface.

    Parameters

    Returns void

  • Registers a handler that is invoked by the associated controller whenever an instant, node, or edge action is to be executed.

    While the action is executed, the callback context.updateActionStatus must be invoked whenever the action transitions to a new status, passing in the new action status together with result description and linked partial state (if applicable).

    If the action context of an action specifies true on the stopDriving property the AGV must stop driving and eventually invoke controller.updateDrivingState before executing the action; otherwise the current driving state must be kept.

    Remarks

    For a node or edge action, the initial action status WAITING is already preset on the controller's current state. For an instant action, no action status is preset on the current state. In both cases, the action handler must initially transition to the action's initial state, either INITIALIZING or RUNNING (or PAUSED if pause mode is activated), FINISHED, or FAILED.

    If pause mode is active, the action to be executed should transition to PAUSED state (immediately or after initializing/running, if needed). If pause mode is deactivated, the action should transition to the previous status again.

    For instant actions 'startPause' and 'stopPause' this handler must pause/resume all other actions, and update their action status and linked state paused accordingly. Node processing of an active order is suspended and resumed automatically by the AGV controller. Edge traversal must be suspended and resumed by the AGV adapter.

    Note that the instant actions 'stateRequest' and 'cancelOrder' are never dispatched to this handler as they are handled by the AGV controller itself.

    Parameters

    • context: ActionContext

      context information of a node, edge, or instant action to be executed

    Returns void

  • Registers a handler that is invoked by the associated controller whenever an active edge action (i.e. one with status unequal FINISHED or FAILED) must be terminated.

    Remarks

    The registered handler is invoked whenever a node is traversed and any active actions on the edge leading up to that node must be terminated. The handler should finish or cancel the action and report an updated action status FINISHED or FAILED via context.updateActionStatus.

    Parameters

    • context: ActionContext

      context information of an edge action to be finished

    Returns void

  • Gets battery reach of vehicle for the given state of charge.

    Returns

    battery reach according to given state of charge

    Parameters

    • charge: number

      battery state of charge (in percent)

    Returns number

  • Gets target speed of vehicle depending on related adapter options.

    Returns

    target speed of vehicle depending on the given parameters and adapter options

    Parameters

    • useMean: boolean = false

      whether to use the constant mean speed or the random speed if a driving speed or time distribution has been specified in the adapter options; otherwise this parameter is ignored

    • distance: number

      the target distance to travel; only used if driving time distribution has been specified in the adapter options

    • Optional maxSpeed: number

      a speed limit that must not be exceeded (optional, only used if no driving distribution function has been specified in the adapter options)

    Returns number

  • Registers a handler that is invoked by the associated controller to check synchronously whether a given node, edge, or instant action can be executed principally.

    The handler function should return a non-empty array of error references if the action cannot be executed and must be rejected. For example, if an action cannot be completed because of external factors (e.g. no load at expected position), or if an action conflicts with the AGV's currently active order (e.g. instant action says to lower fork while order says to raise fork), or if the order contains actions the vehicle cannot perform (e.g. lifting height higher than maximum lifting height, or lifting actions although no stroke is installed).

    If the action can be executed, the handler should return an empty array or undefined.

    Remarks

    You should not include the actionId and the actionType as error references as these are added automatically by the controller. If the error was caused by erroneous action parameters, include a list of parameters in the reference.

    If an instant action is not executable in principle it will be rejected with an error by the AGV controller. If a node or edge action is not executable in principle, the order will be rejected by the AGV controller. In the latter case all order node and edge actions are checked for executability before the order is carried out.

    Returns

    an array of error references if action cannot be executed; an empty array or undefined if action can be executed

    Parameters

    • context: ActionContext

      context information of a node, edge, or instant action to be checked for execution

    Returns ErrorReference[]

  • Registers a handler that is invoked by the associated controller whenever it needs to check whether a given node's position is within the allowed deviation range of the current AGV position.

    The handler function should return an array of error references if the node is not within the deviation range by checking the node properties x, y, theta, mapId, allowedDeviationTheta, and allowedDeviationXy against the current AGV position. Otherwise, the handler should return an empty array or undefined.

    Remarks

    You should not include the nodeId as error reference as it is added automatically by the controller. Instead, include all node property-value pairs that fail the check.

    Returns

    an array of error references if node is not within deviation range; an empty array or undefined otherwise

    Parameters

    • node: Node

      a Node object

    Returns ErrorReference[]

  • Registers a handler that is invoked by the associated controller to check synchronously whether AGV can traverse a given route with regard to vehicle-specific constraints on node/edge properties that must be validated by the AGV adapter as the AGV controller is not aware of them.

    The nodes and edges passed to this handler are guaranteed to be well-formed and valid with respect to the proper sequence of base/horizon nodes and edges.

    Node and edge actions must not be checked by this handler; they are checked individually by the handler isActionExecutable.

    The handler function should return an array of error references if the route cannot be traversed. For example, if an edge has fields that the vehicle cannot use (e.g. trajectory) or misses fields it requires (e.g. nodePosition with mapId for free navigation) or fields it doesn't support (e.g. rotationAllowed). Otherwise, the handler should return an empty array or undefined.

    Returns

    an array of error references if route cannot be traversed; an empty array or undefined otherwise

    Parameters

    Returns ErrorReference[]

  • Vehicle starts driving with the given velocity.

    Parameters

    • vx: number

      velocity in x direction

    • vy: number

      velocity in y direction

    • reportImmediately: boolean = false

      true if velocity update should be reported immediately; false otherwise

    Returns void

  • Vehicle stops driving.

    Parameters

    • reportImmediately: boolean = false

      true if velocity update should be reported immediately; false otherwise

    Returns void

  • Registers a handler that is invoked by the associated controller whenever the AGV should stop driving while the active order is being canceled and after all node/edge actions of this order have already been canceled.

    If the AGV is on a node or can stop if in between nodes, it should stop gracefully; otherwise it should continue driving to the next node, and automatically stop on arrival. In all these cases the traverse handler's callback context.edgeTraversed should not be invoked any more (even if you do invoke it, it is ignored by the AGV controller).

    The handler function must invoke the callback context.stopped once as soon as the AGV has stopped driving, even if the vehicle is already stopped for another reason. After reporting this state the AGV should be able to receive a new order. Until this callback has been called it is guaranteed that no other invocation of this handler occurs.

    If the AGV's capabilities require it to drive to the next node before stopping, the adapter must invoke both the callback context.drivingToNextNode immediately and the callback context.stopped after stopping on arrival.

    Remarks

    It is guaranteed that whenever this function is called all scheduled node and edge actions of the order to be canceled have ended, i.e. are either in status FINISHED or FAILED.

    Parameters

    Returns void

  • Updates battery state of vehicle according to the given travel distance.

    Parameters

    • dx: number

      distance travelled in x direction

    • dy: number

      distance travelled in y direction

    Returns void

Generated using TypeDoc