SkillProxy.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace armarx
7 {
8  namespace skills
9  {
10  /* Manages the remote execution of a skill and converts the ice types */
11  class SkillProxy : public armarx::Logging
12  {
13  public:
14  /// We remove the default constructor as every skill proxy requires a manager
15  SkillProxy() = delete;
16 
17  /// set the skill proxy using a skillId. Queries the manager to get the description.
18  SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager,
19  const SkillID& skillId);
20 
21  /// set the proxy using a skill description
22  SkillProxy(const manager::dti::SkillManagerInterfacePrx& manager,
23  const SkillDescription& skillDesc);
24 
25  /// copy ctor
26  SkillProxy(const SkillProxy& o) = default;
27 
28  /// get the skill description
30 
31  /// get the skill id from the skill description
32  SkillID getSkillId() const;
33 
34  // Provide a similar API as the skillprovider
35  /// execute a skill and block until skill terminates
37  executeSkill(const std::string& executorName,
38  const aron::data::DictPtr& params = nullptr) const;
39 
40  /// execute a skill. Do not block during execution
41  SkillExecutionID executeSkillAsync(const std::string& executorName,
42  const aron::data::DictPtr& params = nullptr) const;
43 
44  /// poll execution status and block until its null or terminated
45  std::optional<TerminatedSkillStatusUpdate>
46  join(const SkillExecutionID& executionId) const;
47 
48  /// ask skill to abort ASAP. Blocks until skill stopped
49  bool abortSkill(const SkillExecutionID& executionId) const;
50 
51  /// ask skill to abort ASAP
52  bool abortSkillAsync(const SkillExecutionID& executionId) const;
53 
54  // Utiliy methods
55  /// get the default parameters of the skill. TODO: Skill profiles in memory!
57 
58  protected:
59  manager::dti::SkillManagerInterfacePrx manager;
61  };
62  } // namespace skills
63 } // namespace armarx
armarx::skills::SkillProxy::getRootProfileParameters
aron::data::DictPtr getRootProfileParameters() const
get the default parameters of the skill. TODO: Skill profiles in memory!
Definition: SkillProxy.cpp:123
armarx::skills::SkillProxy::executeSkill
TerminatedSkillStatusUpdate executeSkill(const std::string &executorName, const aron::data::DictPtr &params=nullptr) const
execute a skill and block until skill terminates
Definition: SkillProxy.cpp:51
armarx::skills::SkillExecutionID
Definition: SkillExecutionID.h:19
skills
This file is part of ArmarX.
SkillStatusUpdate.h
armarx::skills::SkillDescription
Definition: SkillDescription.h:18
armarx::skills::SkillProxy::manager
manager::dti::SkillManagerInterfacePrx manager
Definition: SkillProxy.h:59
armarx::skills::SkillProxy
Definition: SkillProxy.h:11
armarx::skills::SkillProxy::skillDescription
SkillDescription skillDescription
Definition: SkillProxy.h:60
armarx::skills::SkillProxy::SkillProxy
SkillProxy()=delete
We remove the default constructor as every skill proxy requires a manager.
armarx::skills::TerminatedSkillStatusUpdate
Definition: SkillStatusUpdate.h:79
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::Logging
Base Class for all Logging classes.
Definition: Logging.h:232
armarx::skills::SkillProxy::getSkillDescription
SkillDescription getSkillDescription() const
get the skill description
Definition: SkillProxy.cpp:39
armarx::skills::SkillProxy::executeSkillAsync
SkillExecutionID executeSkillAsync(const std::string &executorName, const aron::data::DictPtr &params=nullptr) const
execute a skill. Do not block during execution
Definition: SkillProxy.cpp:65
armarx::skills::SkillProxy::join
std::optional< TerminatedSkillStatusUpdate > join(const SkillExecutionID &executionId) const
poll execution status and block until its null or terminated
Definition: SkillProxy.cpp:79
armarx::skills::SkillProxy::abortSkill
bool abortSkill(const SkillExecutionID &executionId) const
ask skill to abort ASAP. Blocks until skill stopped
Definition: SkillProxy.cpp:107
armarx::skills::SkillProxy::abortSkillAsync
bool abortSkillAsync(const SkillExecutionID &executionId) const
ask skill to abort ASAP
Definition: SkillProxy.cpp:115
armarx::skills::SkillID
Definition: SkillID.h:17
armarx::skills::SkillProxy::getSkillId
SkillID getSkillId() const
get the skill id from the skill description
Definition: SkillProxy.cpp:45
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
SkillDescription.h