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