|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface CustomNodeAction
Interface for user-definable actions that are to be performed at TopologyNodes. Custom node actions that are
configured at nodes will be considered during planning along with all other motions and actions. Thus, they allow for
plans including specific actions that will be performed upon arrival at or departure from topology nodes.
A custom node action's implementation must strictly abide by a number of constraints documented for the affected
methods because the planning- and execution-phases of the FleetManager rely on these constraints. For
example, it must be ensured by the implementation that the robot executing the motion never leaves the node or
changes its orientation during execution. Should any of these constraints be violated no guarantees are given
regarding the execution of the GraphMotion in which the user-definable action takes place and the resulting
state of the fleet.
Note that any RecoverAction configured to a motion on a TopologyEdge leaving the node at which an
action is to be performed will be executed after the action has been completed. Thus, it is not safe to assume
that possible tracking inaccuracies regarding the robot's pose with regard to the node position have been repaired at
the time of execution of the the action even if recover actions have been configured.
It is not recommended to inject any other classes like the MobileRobotManager or ITaskLogger in the
implementing class. The preferred way is to give this as arguments in constructor or setters. Bear in mind to copy
such fields in copy()-method.
| Method Summary | |
|---|---|
void |
cancel()
Cancels this CustomNodeAction. |
CustomNodeAction |
copy()
Returns a copy of this CustomNodeAction. |
Set<NodeActionExecutionType> |
defineWhen(CustomNodeActionContext ctx)
Defines when this custom node action will be executed by returning a set of NodeActionExecutionTypes. |
double |
getEstimatedExecutionTime(TopologyNode node)
Gets the estimated execution time of the action. |
void |
run(CustomNodeActionContext ctx)
Executes the user defined custom node action. |
| Method Detail |
|---|
void run(CustomNodeActionContext ctx)
The following constraints must strictly be respected by this action's implementation:
CommandExecutionException such that the fleet manager can react
accordingly. This is true in particular for any error held by a motion container of any motion executed within
this action.
ctx - the CustomNodeActionContext in which this action will be executeddouble getEstimatedExecutionTime(TopologyNode node)
Method can be called in two different contexts: The execution of this action at the given node has not yet been
started or the action is being executed at the time of call. Any implementation of this method must ensure that
suitable return-values are generated in both cases. It is possible to rely on dynamic information in the second
case if dynamic information contained in the CustomNodeActionContext provided to
run(CustomNodeActionContext) are stored in some field variables by this method's implementation.
However, in the first case it must be ensured that the estimate for the given node can also be computed
statically.
node - the TopologyNode at which this action is going to be executed
Set<NodeActionExecutionType> defineWhen(CustomNodeActionContext ctx)
NodeActionExecutionTypes.
This set indicates when this action will be executed in the following sense:
If the returned set contains NodeActionExecutionType.LEAVE, then this action will be the last action that
is executed before the robot executing the underlying GraphMotion leaves the TopologyNode (in
order to move to a different topology node) that was furnished with this action. In particular, if the robot must
perform a rotation at the node, this rotation will be performed before execution of this action. In the special
case where the path computed for the graph motion ends in the corresponding topology node the type
NodeActionExecutionType.LEAVE indicates that the corresponding custom node action will be the last step
in the computed path.
If the returned set contains NodeActionExecutionType.REACH, then this action will executed immediately
after the motion by which the robot executing the underlying GraphMotion reaches the TopologyNode
(from a different topology node) that was furnished with this action. In particular, if the robot must perform a
rotation at the node, this action will be executed before the rotation. In the special case where the path
computed for the graph motion starts in the corresponding topology node the type
NodeActionExecutionType.REACH indicates that the corresponding custom node action will be the first step
in the computed path.
Thus, in particular it is possible that this action is performed twice at a topology node, once upon arrival at the node and once before departure, if the returned set contains both execution types above or not at all if the returned set is empty.
Note that this method's implementation must handle the possibility that the provided custom node action context's
execution type may be null.
ctx - the CustomNodeActionContext in which this action will be executed. The context's execution
type may be null.
NodeActionExecutionTypes as described above.void cancel()
CustomNodeAction. This method's implementation must ensure that the specific actions of this
topology node action are terminated and cleaned up accordingly. After the call the corresponding
GraphMotionContainer's state will change to FINALIZED.
CustomNodeAction copy()
CustomNodeAction. The method's implementation must ensure that all relevant fields
of this action are passed to the new instance. This is in particular true for all fields that were injected if
this action was obtained using the injection-mechanism.
CustomNodeAction-instance with relevant values representing a copy of this action.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||