|
Manages the planning of the addirrt* algorithm. More...
#include <RobotComponents/components/MotionPlanning/Tasks/AdaptiveDynamicDomainInformedRRTStar/ManagerNode.h>
Public Member Functions | |
PathWithCostSeq | getAllPathsWithCost (const Ice::Current &=Ice::emptyCurrent) const override |
PathWithCost | getBestPath (const Ice::Current &=Ice::emptyCurrent) const override |
std::string | getDefaultName () const override |
Ice::Int | getMaxCpus (const Ice::Current &=Ice::emptyCurrent) const override |
Ice::Long | getNodeCount (const Ice::Current &=Ice::emptyCurrent) const override |
PathWithCost | getNthPathWithCost (Ice::Long n, const Ice::Current &=Ice::emptyCurrent) const override |
Ice::Long | getPathCount (const Ice::Current &=Ice::emptyCurrent) const override |
FullIceTree | getTree (const Ice::Current &=Ice::emptyCurrent) const override |
Update | getUpdate (Ice::Long workerId, Ice::Long updateId, const Ice::Current &=Ice::emptyCurrent) const override |
void | kill (const Ice::Current &=Ice::emptyCurrent) override |
Sets the flag to stop planning. More... | |
ManagerNode (TaskBasePrx task, RemoteObjectNodePrxList remoteObjectNodes, Ice::Long initialWorkerCount, Ice::Long maximalWorkerCount, const cprs::ComputingPowerRequestStrategyBasePtr &planningComputingPowerRequestStrategy, float dcdStep, Ice::Long maximalPlanningTimeInSeconds, Ice::Long batchSize, Ice::Long nodeCountDeltaForGoalConnectionTries, CSpaceBasePtr cspace, VectorXf startCfg, VectorXf goalCfg, AdaptiveDynamicDomainParameters addParams, float targetCost) | |
Ctor. More... | |
void | onConnectComponent () override |
noop. More... | |
void | onDisconnectComponent () override |
noop. More... | |
void | onExitComponent () override |
Stopps planning and joins the manager thread. More... | |
void | onInitComponent () override |
Initializes the tree and sampler. More... | |
void | sendManagerNodeData () const |
Sents the manager's collected test data to the task. More... | |
void | setMaxCpus (Ice::Int maxCpus, const Ice::Current &=Ice::emptyCurrent) override |
void | setWorkersFinalUpdateId (Ice::Long workerId, Ice::Long finalUpdateId, const Ice::Current &) override |
Used by workers to inform the manager about their number of updates before exiting. More... | |
void | updateTree (const Update &u, const Ice::Current &=Ice::emptyCurrent) override |
Adds the given update to the queue of pending updates. More... | |
~ManagerNode () override | |
dtor. More... | |
Public Member Functions inherited from ManagedIceObject | |
void | enableProfiler (bool enable) |
setProfiler allows setting ManagedIceObject::profiler to a new instance (if the new instance is actually not a null pointer) More... | |
std::string | generateSubObjectName (const std::string &subObjectName) |
Generates a unique name for a sub object from a general name. More... | |
ArmarXManagerPtr | getArmarXManager () const |
Returns the ArmarX manager used to add and remove components. More... | |
ManagedIceObjectConnectivity | getConnectivity () const |
Retrieve connectivity of the object (topcis as well as proxies) More... | |
IceManagerPtr | getIceManager () const |
Returns the IceManager. More... | |
VariantBasePtr | getMetaInfo (const std::string &id) |
StringVariantBaseMap | getMetaInfoMap () const |
std::string | getName () const |
Retrieve name of object. More... | |
Ice::ObjectAdapterPtr | getObjectAdapter () const |
Returns object's Ice adapter. More... | |
ArmarXObjectSchedulerPtr | getObjectScheduler () const |
PeriodicTaskPtr | getPeriodicTask (const std::string &name) |
Profiler::ProfilerPtr | getProfiler () const |
getProfiler returns an instance of armarx::Profiler More... | |
template<class ProxyTarg , class... Args> | |
void | getProxy (const char *name, IceInternal::ProxyHandle< ProxyTarg > &proxy, Args &&...args) |
template<class ProxyType > | |
ProxyType | getProxy (const std::string &name, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true) |
Retrieves a proxy object. More... | |
template<class ProxyTarg , class... Args> | |
void | getProxy (const std::string &name, IceInternal::ProxyHandle< ProxyTarg > &proxy, Args &&...args) |
template<class ProxyTarg , class... Args> | |
void | getProxy (IceInternal::ProxyHandle< ProxyTarg > &proxy, const char *name, Args &&...args) |
template<class ProxyTarg , class... Args> | |
void | getProxy (IceInternal::ProxyHandle< ProxyTarg > &proxy, const std::string &name, Args &&...args) |
Assigns a proxy to proxy . More... | |
Ice::ObjectPrx | getProxy (long timeoutMs=0, bool waitForScheduler=true) const |
Returns the proxy of this object (optionally it waits for the proxy) More... | |
template<class Prx > | |
Prx | getProxy (long timeoutMs=0, bool waitForScheduler=true) const |
template<class ProxyType > | |
void | getProxy (ProxyType &proxy, const char *name, bool addToDependencies=false, const std::string &endpoints="", bool throwOnProxyError=true) |
Overload to allow using string literals as name (solve ambiguous overload). More... | |
template<class Prx > | |
void | getProxy (Prx &prx, long timeoutMs=0, bool waitForScheduler=true) const |
int | getState () const |
Retrieve current state of the ManagedIceObject. More... | |
template<class TopicProxyType > | |
TopicProxyType | getTopic (const std::string &name) |
Returns a proxy of the specified topic. More... | |
template<class TopicProxyType > | |
void | getTopic (TopicProxyType &topicProxy, const std::string &name) |
Assigns a proxy of the specified topic to topicProxy . More... | |
std::vector< std::string > | getUnresolvedDependencies () const |
returns the names of all unresolved dependencies More... | |
ManagedIceObject (ManagedIceObject const &other) | |
void | offeringTopic (const std::string &name) |
Registers a topic for retrival after initialization. More... | |
void | preambleGetTopic (std::string const &name) |
void | setMetaInfo (const std::string &id, const VariantBasePtr &value) |
Allows to set meta information that can be queried live via Ice interface on the ArmarXManager. More... | |
void | startPeriodicTask (const std::string &uniqueName, std::function< void(void)> f, int periodMs, bool assureMeanInterval=false, bool forceSystemTime=true) |
bool | stopPeriodicTask (const std::string &name) |
bool | unsubscribeFromTopic (const std::string &name) |
Unsubscribe from a topic. More... | |
bool | usingProxy (const std::string &name, const std::string &endpoints="") |
Registers a proxy for retrieval after initialization and adds it to the dependency list. More... | |
void | usingTopic (const std::string &name, bool orderedPublishing=false) |
Registers a proxy for subscription after initialization. More... | |
void | waitForObjectScheduler () |
Waits until the ObjectScheduler could resolve all dependencies. More... | |
void | waitForProxy (std::string const &name, bool addToDependencies) |
Public Member Functions inherited from Logging | |
SpamFilterDataPtr | deactivateSpam (float deactivationDurationSec=10.0f, const std::string &identifier="", bool deactivate=true) const |
disables the logging for the current line for the given amount of seconds. More... | |
MessageTypeT | getEffectiveLoggingLevel () const |
Logging () | |
void | setLocalMinimumLoggingLevel (MessageTypeT level) |
With setLocalMinimumLoggingLevel the minimum verbosity-level of log-messages can be set. More... | |
void | setTag (const LogTag &tag) |
void | setTag (const std::string &tagName) |
virtual | ~Logging () |
Protected Member Functions | |
void | applyUpdatesNotThreadSafe (std::unique_lock< std::mutex > &updateLock) |
Applies all pending updates. More... | |
void | cacheAppliedUpdateRequiresUpdateMutex (Update &&u) |
Stores the given applied update to the cache. More... | |
void | cleanupAllWorkers () |
Shuts down and removes all workers. More... | |
void | createNewWorker () |
Creates a new worker. More... | |
void | createNewWorkerOn (std::size_t remoteObjectNodeIndex) |
Creates a new worker on the given remote object node. More... | |
std::size_t | getActiveWorkerCount () const |
getActiveWorkerCount returns the number of currently active workers. More... | |
const Update & | getLocalUpdateRequiresUpdateMutex (std::size_t workerId, std::size_t updateId) const |
Returns the requested update from the cache. More... | |
Update | getRemoteUpdate (std::size_t workerId, std::size_t updateId) const |
Returns the requested update fetched from the corresponding worker. More... | |
std::size_t | getWorkerCount () const |
Returns the number of currently available workers (both active and paused). More... | |
bool | hasLocalUpdateRequiresUpdateMutex (std::size_t workerId, std::size_t updateId) const |
Returns whether the given update is cached. More... | |
bool | hasTimeRunOut () |
bool | isPlanningDone () |
ManagerNode ()=default | |
Ctor used by ice factories. More... | |
void | managerTask () |
The managet task.checkedCastIt checks whether new workers are required and starts them if this is the case. More... | |
Protected Member Functions inherited from ManagedIceObject | |
template<class PluginT , class... ParamsT> | |
PluginT * | addPlugin (const std::string prefix="", ParamsT &&...params) |
template<class PluginT , class... ParamsT> | |
void | addPlugin (PluginT *&targ, const std::string prefix="", ParamsT &&...params) |
template<class PluginT , class... ParamsT> | |
void | addPlugin (std::experimental::observer_ptr< PluginT > &targ, const std::string prefix="", ParamsT &&...params) |
Ice::CommunicatorPtr | getCommunicator () const |
std::unique_ptr< ManagedIceObjectPlugin > & | getPluginPointer (std::type_info const &type, std::string const &prefix) |
ManagedIceObject () | |
Protected default constructor. More... | |
virtual void | postOnConnectComponent () |
virtual void | postOnDisconnectComponent () |
virtual void | postOnExitComponent () |
virtual void | postOnInitComponent () |
virtual void | preOnConnectComponent () |
virtual void | preOnDisconnectComponent () |
virtual void | preOnExitComponent () |
virtual void | preOnInitComponent () |
bool | removeProxyDependency (const std::string &name) |
This function removes the dependency of this object on the in parameter name specified object. More... | |
void | setName (std::string name) |
Override name of well-known object. More... | |
void | terminate () |
Initiates termination of this IceManagedObject. More... | |
~ManagedIceObject () override | |
Protected Member Functions inherited from Logging | |
bool | checkLogLevel (MessageTypeT level) const |
const LogSenderPtr & | getLogSender () const |
Retrieve log sender. More... | |
LogSenderPtr | loghelper (const char *file, int line, const char *function) const |
Protected Attributes | |
std::atomic_size_t | activeWorkerCount |
currentlyActiveWorkers the index of the newest planning process in the workers vector (is <= workers.size()). More... | |
std::vector< std::deque< Update > > | appliedUpdates |
All applied updates. More... | |
std::atomic_bool | killRequest |
Flag to signal the manager thread to exit. More... | |
std::condition_variable | managerEvent |
CV used by the manager thread to wait for new updates. More... | |
std::thread | managerThread |
The tread executing managerTask. More... | |
std::vector< std::size_t > | maxWorkersPerRemoteObjectNode |
How many workers are maximal allowed on each remote object node. More... | |
Ice::FloatSeq | rotationMatrix |
The rotation matrix used by the informed samplers. More... | |
ClockType::time_point | timepointStart |
Timepoint when the manager node started planning. More... | |
Tree | tree |
The RRT. More... | |
std::mutex | treeMutex |
protects the tree data More... | |
std::mutex | updateMutex |
Protects the update section of the tree and the update cache of the manager. More... | |
std::string | updateTopicPrefix |
The update topic's prefix. More... | |
std::mutex | workerMutex |
used to lock access to the vector workers More... | |
std::vector< RemoteHandle< WorkerNodeBasePrx > > | workers |
Worker proxies. More... | |
std::vector< Ice::Long > | workersFinalUpdateId |
Used when shutting down to ensure all updates were applied before destroying the nodes remote object. More... | |
std::vector< std::size_t > | workersPerRemoteObjectNode |
How many workers are started on each remote object node. More... | |
Protected Attributes inherited from Logging | |
MessageTypeT | minimumLoggingLevel |
SpamFilterDataPtr | spamFilter |
LogTag | tag |
Friends | |
class | GenericFactory< ManagerNodeBase, ManagerNode > |
class | ManagedIceObject |
required for static factory methode create More... | |
Additional Inherited Members | |
Public Types inherited from ManagedIceObject | |
using | PeriodicTaskPtr = IceUtil::Handle< SimplePeriodicTask< std::function< void(void)> >> |
Static Public Member Functions inherited from ManagedIceObject | |
static std::string | generateSubObjectName (const std::string &superObjectName, const std::string &subObjectName) |
Generates a unique name for a sub object from a general name and unique name. More... | |
static std::string | GetObjectStateAsString (int state) |
Static Public Attributes inherited from ManagedIceObject | |
static const ManagedIceObjectPtr | NullPtr |
A nullptr to be used when a const ref to a nullptr is required. More... | |
Manages the planning of the addirrt* algorithm.
Starts workers and checks whether the planning should end.
Definition at line 58 of file ManagerNode.h.
|
inline |
Ctor.
task | The manager node's task. The manager will store its result in it. |
remoteObjectNodes | RemoteObjectNodes used for parallelization. |
initialWorkerCount | The initial worker count. |
maximalWorkerCount | The maximal worker count. |
planningComputingPowerRequestStrategy | The used cprs. |
dcdStep | The dcd step size. |
maximalPlanningTimeInSeconds | The maximal planning time in seconds. Planning will end after this time. |
batchSize | The size of a batch. |
nodeCountDeltaForGoalConnectionTries | deprecated |
cspace | The used planning cspace. |
startCfg | The start configuration. |
goalCfg | The goal configuration. |
addParams | Parameters for adaptive dynamic domain. |
targetCost | The target cost. Planning will end after shorter path was found.. |
Definition at line 84 of file ManagerNode.h.
|
inlineoverride |
|
protecteddefault |
Ctor used by ice factories.
|
protected |
Applies all pending updates.
(requires the user to hold update and tree mutex)
updateLock | Lock for the update mutex. it will be unlocked when getting a remote update. |
Definition at line 504 of file ManagerNode.cpp.
|
protected |
Stores the given applied update to the cache.
(requires the caller to hold the updateMutex)
u | The update. |
Definition at line 523 of file ManagerNode.cpp.
|
protected |
Shuts down and removes all workers.
(Their newest data is fetched before destruction.)
Definition at line 442 of file ManagerNode.cpp.
|
protected |
Creates a new worker.
(the remote object node is selected automatically)
Definition at line 375 of file ManagerNode.cpp.
|
protected |
Creates a new worker on the given remote object node.
remoteObjectNodeIndex | The remote object node's index. |
Definition at line 335 of file ManagerNode.cpp.
|
inlineprotected |
getActiveWorkerCount returns the number of currently active workers.
Definition at line 304 of file ManagerNode.h.
|
override |
Definition at line 133 of file ManagerNode.cpp.
|
override |
Definition at line 113 of file ManagerNode.cpp.
|
inlineoverridevirtual |
Implements ManagedIceObject.
Definition at line 153 of file ManagerNode.h.
|
protected |
Returns the requested update from the cache.
(requires the caller to hold the updateMutex)
workerId | The updates worker id. |
updateId | The updates sub id. |
Definition at line 409 of file ManagerNode.cpp.
|
override |
Definition at line 561 of file ManagerNode.cpp.
|
override |
Definition at line 538 of file ManagerNode.cpp.
|
override |
index | The index. |
Definition at line 125 of file ManagerNode.cpp.
|
override |
Definition at line 120 of file ManagerNode.cpp.
|
protected |
Returns the requested update fetched from the corresponding worker.
(requires the caller to hold the updateMutex)
workerId | The updates worker id. |
updateId | The updates sub id. |
Definition at line 395 of file ManagerNode.cpp.
|
override |
Definition at line 167 of file ManagerNode.cpp.
|
override |
workerId | The updates worker id. |
updateId | The updates sub id. |
Definition at line 148 of file ManagerNode.cpp.
|
inlineprotected |
Returns the number of currently available workers (both active and paused).
Definition at line 313 of file ManagerNode.h.
|
protected |
Returns whether the given update is cached.
(requires the caller to hold the updateMutex)
workerId | The updates worker id. |
updateId | The updates sub id. |
Definition at line 403 of file ManagerNode.cpp.
|
protected |
Definition at line 550 of file ManagerNode.cpp.
|
protected |
Definition at line 544 of file ManagerNode.cpp.
|
inlineoverride |
Sets the flag to stop planning.
Definition at line 162 of file ManagerNode.h.
|
protected |
The managet task.checkedCastIt checks whether new workers are required and starts them if this is the case.
Ith checks whether planing has finished.
Definition at line 176 of file ManagerNode.cpp.
|
overridevirtual |
noop.
(debug output)
Implements ManagedIceObject.
Definition at line 96 of file ManagerNode.cpp.
|
inlineoverridevirtual |
noop.
(debug output)
Reimplemented from ManagedIceObject.
Definition at line 142 of file ManagerNode.h.
|
overridevirtual |
Stopps planning and joins the manager thread.
Reimplemented from ManagedIceObject.
Definition at line 104 of file ManagerNode.cpp.
|
overridevirtual |
Initializes the tree and sampler.
Starts the manager thread.
Implements ManagedIceObject.
Definition at line 38 of file ManagerNode.cpp.
void sendManagerNodeData | ( | ) | const |
Sents the manager's collected test data to the task.
|
override |
Definition at line 556 of file ManagerNode.cpp.
|
override |
Used by workers to inform the manager about their number of updates before exiting.
Used by the manager to fetch all remaining updates before exiting.
workerId | The worker. |
finalUpdateId | Its final update id. |
Definition at line 422 of file ManagerNode.cpp.
|
override |
Adds the given update to the queue of pending updates.
u | The update. |
Definition at line 435 of file ManagerNode.cpp.
|
friend |
Definition at line 226 of file ManagerNode.h.
|
friend |
required for static factory methode create
Definition at line 395 of file ManagerNode.h.
|
protected |
currentlyActiveWorkers the index of the newest planning process in the workers vector (is <= workers.size()).
Definition at line 330 of file ManagerNode.h.
|
protected |
|
protected |
Flag to signal the manager thread to exit.
Definition at line 322 of file ManagerNode.h.
|
protected |
CV used by the manager thread to wait for new updates.
Definition at line 375 of file ManagerNode.h.
|
protected |
The tread executing managerTask.
Definition at line 326 of file ManagerNode.h.
|
protected |
How many workers are maximal allowed on each remote object node.
Definition at line 343 of file ManagerNode.h.
|
protected |
The rotation matrix used by the informed samplers.
Definition at line 384 of file ManagerNode.h.
|
protected |
Timepoint when the manager node started planning.
Used to check whether the maximal planning time was exceeded.
Definition at line 390 of file ManagerNode.h.
|
protected |
The RRT.
Definition at line 379 of file ManagerNode.h.
|
mutableprotected |
protects the tree data
Definition at line 371 of file ManagerNode.h.
|
mutableprotected |
Protects the update section of the tree and the update cache of the manager.
Definition at line 353 of file ManagerNode.h.
|
protected |
|
mutableprotected |
used to lock access to the vector workers
Definition at line 347 of file ManagerNode.h.
|
protected |
Worker proxies.
worker[i][j] is the j-th worker on the remote object node remoteObjectNodes[i]
Definition at line 335 of file ManagerNode.h.
|
protected |
Used when shutting down to ensure all updates were applied before destroying the nodes remote object.
Definition at line 366 of file ManagerNode.h.
|
protected |
How many workers are started on each remote object node.
Definition at line 339 of file ManagerNode.h.