com.kuka.nav.fleet
Class GraphMotion

java.lang.Object
  extended by com.kuka.nav.command.AbstractParameterizable
      extended by com.kuka.nav.fleet.GraphMotion
All Implemented Interfaces:
com.kuka.parameters.IParameterizable

public class GraphMotion
extends com.kuka.nav.command.AbstractParameterizable

The graph motion implementation class.


Constructor Summary
protected GraphMotion(com.kuka.parameters.IParameterMap params, List<? extends TopologyNodeId> whiteList, List<? extends TopologyNodeId> blackList)
          Copy constructor.
  GraphMotion(TopologyGraph graph, TopologyNodeId goal)
          Creates a new graph motion in the specified graph to the specified goal node.
 
Method Summary
 GraphMotion addViaNode(TopologyNodeId via)
          Appends the given via node to the list of via nodes of this graph motion.
 GraphMotion addViaNodes(List<? extends TopologyNodeId> vias)
          Appends a list of via nodes to the list of via nodes defined for this graph motion.
 GraphMotion clearViaNodes()
          Clears the via nodes list.
 GraphMotion copy()
          Creates a deep copy of the command.
 boolean equals(Object obj)
           
 List<TopologyNode> getBlackList()
          Gets the list of black-listed nodes of this graph motion.
 String getDescription()
          Gets the textual description of the command.
 TopologyNode getGoalNode()
          Gets the goal node of this graph motion.
 Double getGoalOrientation()
          Gets the goal orientation of this graph motion.
 TopologyGraph getGraph()
          Gets the graph of this graph motion.
 GraphMotionIdentifier getIdentifier()
          Returns the identifier for this graph motion.
 int getPriority()
          Gets this graph motion's priority.
 DispatcherFilter getResourceFilter()
          Gets the resource filter specifying resources with required capabilities to complete the graph motion.
 List<TopologyNode> getViaNodes()
          Gets the via nodes of this graph motion.
 List<TopologyNode> getWhiteList()
          Gets the list of white-listed nodes of this graph motion.
 boolean hasBlackList()
          Checks whether this graph motion has a black-list.
 int hashCode()
           
 boolean hasWhiteList()
          Checks whether this graph motion has a white-list.
 GraphMotion setBlackList(List<? extends TopologyNodeId> blackList)
          Sets the black-listed nodes for this graph motion.
 GraphMotion setDescription(String description)
          Sets textual description for the command.
 GraphMotion setGoalNode(TopologyNodeId goal)
          Sets the goal node of this graph motion.
 GraphMotion setGoalOrientation(double orientation)
          Sets the goal orientation of this graph motion.
 GraphMotion setGraph(TopologyGraph graph)
          Sets the graph of this graph motion.
protected  void setIdentifier()
          Sets a new identifier for this graph motion.
 GraphMotion setPriority(int prio)
          Sets this graph motion's priority.
 GraphMotion setResourceFilter(DispatcherFilter filter)
          Sets the DispatcherFilter specifying the robot configuration required to perform the graph motion.
 GraphMotion setViaNodes(List<? extends TopologyNodeId> vias)
          Sets the list of via nodes of this graph motion to the given list of via nodes.
 GraphMotion setWhiteList(List<? extends TopologyNodeId> whiteList)
          Sets the white-listed nodes for this graph motion.
 String toString()
           
 
Methods inherited from class com.kuka.nav.command.AbstractParameterizable
getParameters, paramHelper
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphMotion

public GraphMotion(TopologyGraph graph,
                   TopologyNodeId goal)
Creates a new graph motion in the specified graph to the specified goal node. By default the graph motion has the lowest possible priority. Use setPriority(int) to adapt the priority.

There are two possible ways to specify the graph and the goal node:

The benefit of the second point is that loading the graph from the data source is circumvented, which can be costly. Note that the objects created with the static factory methods are identifiers only and do not reflect the state of the corresponding element in the data source.

Example: Creating a graph motion in graph with id 3 to node with name "goal node":

 
 new GraphMotion(TopologyGraph.withId(3), TopologyNode.withName("goal node"));
 
 

Parameters:
graph - the graph
goal - the goal node
See Also:
TopologyGraph.withId(int), TopologyGraph.withName(String), TopologyNodeId.withId(int), TopologyNodeId.withName(String)

GraphMotion

protected GraphMotion(com.kuka.parameters.IParameterMap params,
                      List<? extends TopologyNodeId> whiteList,
                      List<? extends TopologyNodeId> blackList)
Copy constructor. Creates a mew instance of the class containing the deep copy of the specified parameter map.

Parameters:
params - parameter map containing the command parameters
whiteList - the whitelist
blackList - the blacklist
Method Detail

getIdentifier

public final GraphMotionIdentifier getIdentifier()
Returns the identifier for this graph motion. The identifier can be used to retrieve the corresponding runtime container from a CoordinatedGraphMotionContainer for this graph motion.

Note that the identifier will change each time this graph motion is modified. Therefore if this graph motion is reused and part of a coupled motion the identifier should be saved after commanding the fleet manager.

Returns:
the identifier for this graph motion

setIdentifier

protected void setIdentifier()
Sets a new identifier for this graph motion.


setDescription

public GraphMotion setDescription(String description)
Sets textual description for the command.

Parameters:
description - description to set.
Returns:
reference to this object (fluent interface).

getDescription

public final String getDescription()
Gets the textual description of the command.

Returns:
the textual description of the command.

getResourceFilter

public final DispatcherFilter getResourceFilter()
Gets the resource filter specifying resources with required capabilities to complete the graph motion.

Returns:
resource filter

setResourceFilter

public GraphMotion setResourceFilter(DispatcherFilter filter)
Sets the DispatcherFilter specifying the robot configuration required to perform the graph motion.

Parameters:
filter - the dispatcher filter (must not be null - a set dispatcher filter can be removed by calling this method with DispatcherFilters.ANY, accepting all configurations)
Returns:
This command.

getGraph

public final TopologyGraph getGraph()
Gets the graph of this graph motion.

Returns:
the graph

setGraph

public GraphMotion setGraph(TopologyGraph graph)
Sets the graph of this graph motion.

Parameters:
graph - the graph (must not be null)
Returns:
This command.

getGoalNode

public final TopologyNode getGoalNode()
Gets the goal node of this graph motion.

Returns:
the goal node

setGoalNode

public GraphMotion setGoalNode(TopologyNodeId goal)
Sets the goal node of this graph motion.

Parameters:
goal - the goal node (must not be null)
Returns:
This command.

setGoalOrientation

public GraphMotion setGoalOrientation(double orientation)
Sets the goal orientation of this graph motion.

Parameters:
orientation - the goal orientation to be set.
Returns:
This command.

getGoalOrientation

public final Double getGoalOrientation()
Gets the goal orientation of this graph motion.

Returns:
The goal orientation of this graph motion.

getViaNodes

public final List<TopologyNode> getViaNodes()
Gets the via nodes of this graph motion. The via nodes are ordered such that the planner will try to find a path to this motion's goal node which first visits, the first via node in this list, then the second node, and so on.

Returns:
a list containing all via nodes

addViaNodes

public GraphMotion addViaNodes(List<? extends TopologyNodeId> vias)
Appends a list of via nodes to the list of via nodes defined for this graph motion.

For consecutive identical via nodes only the first node is taken into account. Depending on the installed planner graph motions defining via nodes can only be executed by themselves and not together with other graph motions.

Parameters:
vias - the via nodes (neither the list of via nodes nor a single element of this list can be null)
Returns:
This command.

setViaNodes

public GraphMotion setViaNodes(List<? extends TopologyNodeId> vias)
Sets the list of via nodes of this graph motion to the given list of via nodes. Any via nodes previously defined for this graph motion are discarded.

For consecutive identical via nodes only the first node is taken into account. Depending on the installed planner graph motions defining via nodes can only be executed by themselves and not together with other graph motions.

Parameters:
vias - the via nodes (neither the list of via nodes nor a single element of this list can be null)
Returns:
This command.

addViaNode

public GraphMotion addViaNode(TopologyNodeId via)
Appends the given via node to the list of via nodes of this graph motion.

For consecutive identical via nodes only the first node is taken into account. Depending on the installed planner graph motions defining via nodes can only be executed by themselves and not together with other graph motions.

Parameters:
via - the via node (must not be null)
Returns:
This command.

clearViaNodes

public GraphMotion clearViaNodes()
Clears the via nodes list.

Returns:
This command.

setPriority

public GraphMotion setPriority(int prio)
Sets this graph motion's priority.

Parameters:
prio - the priority to be set, must be non-negative (0 corresponds to the highest priority)
Returns:
this graph motion

getPriority

public final int getPriority()
Gets this graph motion's priority.

Returns:
the priority

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

copy

public GraphMotion copy()
Creates a deep copy of the command.

Returns:
a deep copy of the command.

toString

public String toString()
Overrides:
toString in class Object

getWhiteList

public final List<TopologyNode> getWhiteList()
Gets the list of white-listed nodes of this graph motion. If this list is not null, then any plan which is found for this motion must only visit the nodes that are contained in this list.

Returns:
The white-list.

setWhiteList

public GraphMotion setWhiteList(List<? extends TopologyNodeId> whiteList)
Sets the white-listed nodes for this graph motion. If a white-list is set, then any plan which is found for this motion must only visit the nodes that are contained in this list. The white-list and the black-list are mutually exclusive, i.e., only at most one can be different from null for a graph motion.

Parameters:
whiteList - List of white-listed nodes (must not contain any null-entry)
Returns:
This command.
Throws:
IllegalArgumentException - if the provided list is not null and a black-list has already been set or the or if the provided list is not null and contains a null-entry.

getBlackList

public final List<TopologyNode> getBlackList()
Gets the list of black-listed nodes of this graph motion. If this list is not null, then any plan found for this graph motion must not visit any node which is contained in this list.

Returns:
the black-list.

setBlackList

public GraphMotion setBlackList(List<? extends TopologyNodeId> blackList)
Sets the black-listed nodes for this graph motion. If a black-list is set, then any plan found for this graph motion must not visit any node which is contained in this list. White-list and black-list are mutually exclusive, i.e., only at most one can be different from null for a graph motion.

Parameters:
blackList - List of black-listed nodes (must not contain any null-entry)
Returns:
This command.
Throws:
IllegalArgumentException - if the provided list is not null and a white-list has already been set or the or if the provided list is not null and contains a null-entry.

hasWhiteList

public final boolean hasWhiteList()
Checks whether this graph motion has a white-list.

Returns:
true if and only if a white-list is set.

hasBlackList

public final boolean hasBlackList()
Checks whether this graph motion has a black-list.

Returns:
true if and only if a black-list is set.


Copyright © 2019. All rights reserved.