|
|
A structure holding and managing all data connected to the tree used in the ADDIRRT* algorithm. More...
#include <RobotComponents/components/MotionPlanning/Tasks/AdaptiveDynamicDomainInformedRRTStar/Tree.h>
Classes | |
| struct | NodeType |
| Represents a node of thr rrt. More... | |
Public Types | |
| using | ConfigType = VectorXf |
| The type of configurations. | |
| using | PendingUpdateLookuptableConstIterator |
| Const iterator for the PendingUpdateLookuptable. | |
| using | PendingUpdateLookuptableIterator = typename PendingUpdateLookuptableType::iterator |
| Iterator for the PendingUpdateLookuptable. | |
| using | PendingUpdateLookuptableType |
| Lookuptable for pending updates. | |
Public Member Functions | |
| void | addGoalReached (const NodeId &goal, float costToGoToGoal) |
| Adds a node to the list of nodes that can reach the goal configuration. | |
| NodeId | addNode (ConfigType cfg, const NodeId &parent, float fromParentCost) |
| Adds a node to the tree. | |
| void | addPendingUpdate (const Update &u) |
| Adds a new update to the list of pending updates. | |
| void | applyPendingUpdates () |
| Applies all pending updates. | |
| template<class LockType, class RemoteUpdateGetter> | |
| void | applyPendingUpdates (LockType &&treeLock, RemoteUpdateGetter getRemoteUpdate) |
| The same as applyPendingUpdates(LockType, RemoteUpdateGetter, UpdateConsumer) but uses an noop as updateConsumer This overload is needed since the defaultparameter does not work. | |
| template<class LockType, class RemoteUpdateGetter, class UpdateConsumer> | |
| void | applyPendingUpdates (LockType &&treeLock, RemoteUpdateGetter getRemoteUpdate, UpdateConsumer updateConsumer=[](Update &&) {}) |
| Applies all pending updates. | |
| void | applyUpdate (const Update &u) |
| Applies the given update. | |
| NodeType & | at (const NodeId &id) |
| const NodeType & | at (const NodeId &id) const |
| NodeType & | at (std::size_t index) |
| const NodeType & | at (std::size_t index) const |
| bool | canApplyUpdate (const Update &u) |
| void | decreaseRadius (const NodeId &id) |
| Decreases a node's radius. | |
| const Ice::LongSeq & | getAppliedUpdateIds () const |
| float | getBestCost () const |
| PathWithCost | getBestPath () const |
| const Update & | getCurrentUpdate () const |
| Ice::Long | getCurrentUpdateId () const |
| FullIceTree | getIceTree () const |
| NodeId | getIdOfIndex (std::size_t index) const |
| std::vector< std::pair< NodeId, float > > | getKNearestNeighboursAndDistances (const ConfigType &cfg, std::size_t k) |
| const std::deque< Update > & | getLocalUpdates () const |
| std::pair< NodeId, float > | getNearestNeighbourAndDistance (const ConfigType &cfg) |
| NodeId | getNextNodeIdFor (std::size_t workerId) |
| NodeType & | getNode (const NodeId &id) |
| const NodeType & | getNode (const NodeId &id) const |
| const std::deque< std::deque< NodeType > > & | getNodes () const |
| float | getNthPathCost (std::size_t n) const |
| NodeIdList | getNthPathIds (std::size_t n) const |
| PathWithCost | getNthPathWithCost (std::size_t n) const |
| std::size_t | getPathCount () const |
| const Update & | getPendingUpdate (std::size_t workerId, std::size_t updateId) const |
| Ice::Long | getPreviousUpdateId () const |
| bool | hasAppliedUpdate (std::size_t workerId, Ice::Long updateId) |
| bool | hasGoalNode (const NodeId &nodeId) const |
| bool | hasPendingUpdate (std::size_t workerId, std::size_t updateId) const |
| void | increaseRadius (const NodeId &id) |
| Increases a node's radius. | |
| void | increaseWorkerCountTo (std::size_t count) |
| Increases the storage of all data structures to be appropriate for count workers. | |
| void | init (const FullIceTree &iceTree, AdaptiveDynamicDomainParameters newaddParams, std::size_t newWorkerId) |
| Initailizes the tree from the given tree. | |
| template<class LockType, class RemoteUpdateGetter, class UpdateConsumer> | |
| void | prepareUpdate (Ice::LongSeq dependetOnUpdateIds, LockType &&treeLock, RemoteUpdateGetter getRemoteUpdate, UpdateConsumer updateConsumer) |
| Prepares an update by applying all dependet on updates. | |
| void | sendCurrentUpdate (TreeUpdateInterfacePrx &prx) |
| Sends the current update to the given proxy. | |
| void | setNodeParent (const NodeId &child, const NodeId &newParent, float fromParentCost) |
| Sets the parent node of child to parent. | |
| std::size_t | size () const |
| Tree ()=default | |
| Default ctor. | |
| Tree (const VectorXf &startCfg) | |
| Creates a tree that can be used to analyze and apply updates. | |
Static Public Attributes | |
| static const NodeId | ROOT_ID {0, 0} |
| The root node's id. | |
Protected Member Functions | |
| void | applyGoalReachedUpdates (const GoalInfoList newGoalNodes) |
| Applies multiple goal reached updates to the tree. | |
| void | applyNodeCreationUpdate (const NodeCreationUpdate &u, std::size_t workerId) |
| Applies a node creation update to the tree. | |
| template<class LockType, class RemoteUpdateGetter, class UpdateConsumer> | |
| void | applyPendingUpdate (std::size_t updateIndex, LockType &&treeLock, RemoteUpdateGetter getRemoteUpdate, UpdateConsumer updateConsumer) |
| Applies one pending update from the list of pending updates. | |
| void | applyRadiusUpdate (const RadiusUpdate &u) |
| Applies a radius update to the tree. | |
| void | applyRewireUpdate (const RewireUpdate &rewireUpdate) |
| Applies a rewire update to the tree. | |
| void | createNewGoalReachedUpdate (const NodeId &goal, float costToGoToGoal) |
| Adds a new goal reached update to the current update. | |
| void | createNewNodeCreationUpdate (const ConfigType &cfg, const NodeId &parent, float fromParentCost) |
| Adds a new node creation update to the current update. | |
| void | createNewRadiusUpdate (const NodeId &id, bool increaseRadius) |
| Adds a new radius update to the current update. | |
| void | createNewRewireUpdate (const NodeId &child, const NodeId &newParent, float fromParentCost) |
| Adds a new node creation update to the current update. | |
| void | doAddGoalReached (const NodeId &goal, float costToGoToGoal) |
| Adds a node to the list of nodes that can reach the goal configuration. | |
| NodeId | doAddNode (ConfigType cfg, const NodeId &parent, float fromParentCost, std::size_t workerId) |
| Adds a node to the tree. | |
| void | doDecreaseRadius (const NodeId &id) |
| Decreases a node's radius. | |
| void | doIncreaseRadius (const NodeId &id) |
| Increases a node's radius. | |
| void | doSetNodeParent (const NodeId &child, const NodeId &newParent, float fromParentCost, bool updateFromStartCost=true) |
| Sets the parent node of child to parent. | |
| PendingUpdateLookuptableIterator | findPendingUpdate (std::size_t workerId, std::size_t updateId) |
| PendingUpdateLookuptableConstIterator | findPendingUpdate (std::size_t workerId, std::size_t updateId) const |
| std::deque< GoalInfo >::const_iterator | getBestCostIt () const |
| Update & | getCurrentUpdateNonConst () |
| VectorXfSeq | getPathTo (NodeId id) const |
| void | prepareNextUpdate () |
| Prepares the next update. | |
| void | pushCosts (const NodeId &root) |
| Updates fromStartCosts for all children from root. | |
Protected Attributes | |
| AdaptiveDynamicDomainParameters | addParams |
| The parameters of adaptive dynamic domain) | |
| Ice::LongSeq | appliedUpdateIds |
| List of ids of applied updates. | |
| std::deque< GoalInfo > | goalNodes |
| List of nodes able to reach the goal configuration. | |
| std::deque< Update > | localUpdates |
| Updates created by this tree. | |
| std::size_t | nodeCount |
| The number of nodes in the rrt. | |
| std::deque< std::deque< NodeType > > | nodes |
| Holds all nodes. | |
| std::deque< Update > | pendingUpdates |
| Updates to apply to the tree. | |
| PendingUpdateLookuptableType | pendingUpdatesLookupTable |
| Speeds up lookup for available updates. | |
| std::size_t | workerId |
| The worker id of this trees owner. | |
A structure holding and managing all data connected to the tree used in the ADDIRRT* algorithm.
Function overview: [public ] applyXYZUpdate(XYZUpdate u): applies an existing update u to the tree [protected] createNewXYZUpdate(...) : creates a new update and adds it to the tree's current update [public ] addNode/{in,de}creaseRadius/setNodeParent/addGoalReached: modifies the tree (through do functions) and adds the corresponding update to the local tree [protected] doXYZ: performs the actual modification of the tree
| using ConfigType = VectorXf |
The type of configurations.
Const iterator for the PendingUpdateLookuptable.
| using PendingUpdateLookuptableIterator = typename PendingUpdateLookuptableType::iterator |
Iterator for the PendingUpdateLookuptable.
Lookuptable for pending updates.
|
default |
Default ctor.
| Tree | ( | const VectorXf & | startCfg | ) |
Creates a tree that can be used to analyze and apply updates.
Other operations are undefined.
| startCfg | The start config. |
|
inline |
Adds a node to the list of nodes that can reach the goal configuration.
(creates an appropriate update)
| goal | The node to add. |
| costToGoToGoal | The cost to reach the gol configuration from the given node. |
| NodeId addNode | ( | ConfigType | cfg, |
| const NodeId & | parent, | ||
| float | fromParentCost ) |
Adds a node to the tree.
(creates an appropriate update)
| cfg | The node's configuration. |
| parent | The node's parent. |
| fromParentCost | The cost of the edge (node, parent) |
| void addPendingUpdate | ( | const Update & | u | ) |
Adds a new update to the list of pending updates.
| u | The update. |
|
inlineprotected |
Applies multiple goal reached updates to the tree.
| newGoalNodes | The new nodes that can reach the goal configuration. |
|
inlineprotected |
Applies a node creation update to the tree.
| u | The update. |
| workerId | The updates source worker. |
|
inlineprotected |
Applies one pending update from the list of pending updates.
| updateIndex | The pending update's index. |
| treeLock | The lock used to protect the update structures. It will be unlocked when getting a remote update. |
| getRemoteUpdate | Function used to request a missing update. |
| updateConsumer | Function used to consume updates after they were added. (will be moved to the consumer) |
|
inline |
Applies all pending updates.
Updates are not consumes. If a required update is missing this methode will fail. (no update getter is providet). This function is not thread save! Use it only in a serial/protected environment.
|
inline |
The same as applyPendingUpdates(LockType, RemoteUpdateGetter, UpdateConsumer) but uses an noop as updateConsumer This overload is needed since the defaultparameter does not work.
| getRemoteUpdate | Function used to request a missing update. |
|
inline |
Applies all pending updates.
| treeLock | The lock used to protect the update structures. It will be unlocked when getting a remote update. |
| getRemoteUpdate | Function used to request a missing update. |
| updateConsumer | Function used to consume updates after they were added. (will be moved to the consumer) |
|
protected |
Applies a radius update to the tree.
| u | The update. |
|
protected |
Applies a rewire update to the tree.
| rewireUpdate | The update. |
| void applyUpdate | ( | const Update & | u | ) |
Applies the given update.
| u | The update. |
|
inline |
| id | The node's id. |
|
inline |
| id | The node's id. |
|
inline |
| index | The node's index. |
|
inline |
| index | The node's index. |
| bool canApplyUpdate | ( | const Update & | u | ) |
| u | The update. |
|
inlineprotected |
Adds a new goal reached update to the current update.
| goal | The node that can reach the goal configuration. |
| costToGoToGoal | The cost to reach the goal configuration from the given node) |
|
inlineprotected |
Adds a new node creation update to the current update.
| cfg | The new node's configuration. |
| parent | The new node's parent node. |
| fromParentCost | The cost of the edge (node, parent) |
|
inlineprotected |
Adds a new radius update to the current update.
| id | The node's id. |
| increaseRadius | Whether the node's radius increases. |
|
inlineprotected |
Adds a new node creation update to the current update.
| child | The rewired child node. |
| newParent | The new parent node. |
| fromParentCost | The cost of the edge (child, new parent) |
|
inline |
Decreases a node's radius.
(creates an appropriate update)
| id | The node. |
|
inlineprotected |
Adds a node to the list of nodes that can reach the goal configuration.
| goal | The node to add. |
| costToGoToGoal | The cost to reach the gol configuration from the given node. |
|
protected |
Adds a node to the tree.
| cfg | The node's configuration. |
| parent | The node's parent. |
| fromParentCost | The cost of the edge (node, parent) |
| workerId | The worker creating this node. |
|
protected |
Decreases a node's radius.
| id | The node. |
|
inlineprotected |
Increases a node's radius.
| id | The node. |
|
protected |
Sets the parent node of child to parent.
(costs are updated)
| child | The cild node. |
| newParent | The new parent node. |
| fromParentCost | The cost of the edge (child, new parent) |
| updateFromStartCost | Whether to update the costs of the subtree beneath cild. |
|
inlineprotected |
| workerId | The update's worker. |
| updateId | The update's sub id. |
|
inlineprotected |
| workerId | The update's worker. |
| updateId | The update's sub id. |
|
inline |
| float getBestCost | ( | ) | const |
|
inlineprotected |
| PathWithCost getBestPath | ( | ) | const |
|
inline |
|
inline |
|
inlineprotected |
| FullIceTree getIceTree | ( | ) | const |
| NodeId getIdOfIndex | ( | std::size_t | index | ) | const |
| index | The index. |
| std::vector< std::pair< NodeId, float > > getKNearestNeighboursAndDistances | ( | const ConfigType & | cfg, |
| std::size_t | k ) |
| cfg | The configuration. |
| k | The number of neighbours. |
|
inline |
|
inline |
| cfg | The configuration. |
|
inline |
| workerId | The worker's id. |
| Tree::NodeType & getNode | ( | const NodeId & | id | ) |
| id | The node's id. |
| const Tree::NodeType & getNode | ( | const NodeId & | id | ) | const |
| id | The node's id. |
|
inline |
|
inline |
| n | The paths index. |
| NodeIdList getNthPathIds | ( | std::size_t | n | ) | const |
| n | The path's index. |
| PathWithCost getNthPathWithCost | ( | std::size_t | n | ) | const |
| n | N |
|
inline |
|
protected |
| id | The node's id. |
|
inline |
| workerId | The update's worker id. |
| updateId | The update's sub id. |
|
inline |
|
inline |
| workerId | The update's worker id. |
| updateId | The update's sub id. |
|
inline |
| nodeId | The node to check. |
|
inline |
| workerId | The update's worker id. |
| updateId | The update's sub id. |
|
inline |
Increases a node's radius.
(creates an appropriate update)
| id | The node. |
| void increaseWorkerCountTo | ( | std::size_t | count | ) |
Increases the storage of all data structures to be appropriate for count workers.
| count | The number of workers. |
| void init | ( | const FullIceTree & | iceTree, |
| AdaptiveDynamicDomainParameters | newaddParams, | ||
| std::size_t | newWorkerId ) |
Initailizes the tree from the given tree.
| iceTree | The tree to use as initial state. |
| newaddParams | The new adaptive dynamic domain parameters. |
| newWorkerId | The owner's worker id. |
|
protected |
Prepares the next update.
(the update to be send)
|
inline |
Prepares an update by applying all dependet on updates.
| dependetOnUpdateIds | The ids of dependet on updates. |
| treeLock | The lock used to protect the update structures. It will be unlocked when getting a remote update. |
| getRemoteUpdate | Function used to request a missing update. |
| updateConsumer | Function used to consume updates after they were added. (will be moved to the consumer) |
|
protected |
Updates fromStartCosts for all children from root.
| root | The root node for the cost update. |
| void sendCurrentUpdate | ( | TreeUpdateInterfacePrx & | prx | ) |
Sends the current update to the given proxy.
A new update is prepared afterwards.
| prx | The proxy to send the update to. |
|
inline |
Sets the parent node of child to parent.
(costs are updated) (creates an appropriate update)
| child | The cild node. |
| newParent | The new parent node. |
| fromParentCost | The cost of the edge (child, new parent) |
|
inline |
|
protected |
The parameters of adaptive dynamic domain)
|
protected |
List of ids of applied updates.
|
protected |
List of nodes able to reach the goal configuration.
|
protected |
Updates created by this tree.
|
protected |
The number of nodes in the rrt.
|
protected |
Holds all nodes.
The node nodes[i][j] is the jth node created by worker i.
|
protected |
Updates to apply to the tree.
|
protected |
Speeds up lookup for available updates.
(O(log(n)) instead of O(n))
maps from UpdateId to the corresponding index in the pendingUpdates vector
|
static |
The root node's id.
|
protected |
The worker id of this trees owner.
(only used for sending updates and skipping updates send by this tree)