SkillProviderExample.cpp
Go to the documentation of this file.
1 
2 #include "SkillProviderExample.h"
3 
5 {
7  {
8  }
9 
12  {
15  return defs;
16  }
17 
18  std::string
20  {
21  return "SkillProviderExample";
22  }
23 
24  void
26  {
27  // Add example skill
28  ARMARX_INFO << "Adding skill HelloWorldSkill";
29  addSkillFactory<HelloWorldSkill>();
30 
31  // Add another lambda example skill
32  {
34  .skillId = SkillID{.skillName = "Foo"},
35  .description = "This skill does exactly nothing.",
36  .rootProfileDefaults = armarx::aron::make_dict(),
38  };
39  addSkillFactory(fooDesc,
40  []()
41  {
42  std::cout << "Hello from Foo." << std::endl;
44  });
45  }
46 
47  // Add another example skill
48  ARMARX_INFO << "Adding skill CallbackSkill";
49  addSkillFactory<CallbackSkill>();
50 
51  // Add timeout skill
52  ARMARX_INFO << "Adding skill TimeoutSkill";
53  addSkillFactory<TimeoutSkill>();
54 
55  // chaining
56  ARMARX_INFO << "Adding skill ChainingSkill";
57  addSkillFactory<ChainingSkill>();
58 
59  // chainingAsync
60  ARMARX_INFO << "Adding skill ChainingAsyncSkill";
61  addSkillFactory<ChainingAsyncSkill>();
62 
63  // incomplete and prepare
64  ARMARX_INFO << "Adding skill IncompleteSkill";
65  addSkillFactory<IncompleteSkill>();
66 
67  // segfault
68  ARMARX_INFO << "Adding skill SegfaultSkill";
69  addSkillFactory<SegfaultSkill>();
70 
71  // random exit status
72  ARMARX_INFO << "Adding skill RandomExitStatus";
73  addSkillFactory<RandomExitStatus>();
74 
75  // random exit status
76  ARMARX_INFO << "Adding skill Sleep";
77  addSkillFactory<Sleep>();
78  // random
79  ARMARX_INFO << "Adding skill RandomChainingSkill";
80  addSkillFactory<RandomChainingSkill>();
81 
82  // insta kill
83  ARMARX_INFO << "Adding skill InstaKill";
84  addSkillFactory<InstantKillSkill>();
85 
86  ARMARX_INFO << "Adding skill BusyWaiting";
87  addSkillFactory<BusyWaitingSkill>();
88 
89  ARMARX_INFO << "Adding skill Recursive";
90  addSkillFactory<RecursiveSkill>();
91  }
92 
93  void
95  {
96  }
97 
98  void
100  {
101  }
102 
103  void
105  {
106  }
107 } // namespace armarx::skills::provider
armarx::skills::TerminatedSkillStatus::Succeeded
@ Succeeded
armarx::aron::make_dict
aron::data::DictPtr make_dict(_Args &&... args)
Definition: Dict.h:107
armarx::skills::SkillID::skillName
std::string skillName
Definition: SkillID.h:41
armarx::skills::SkillDescription
Definition: SkillDescription.h:17
armarx::skills::provider::SkillProviderExample::SkillProviderExample
SkillProviderExample()
Definition: SkillProviderExample.cpp:6
armarx::SkillProviderComponentPluginUser
Definition: SkillProviderComponentPlugin.h:109
armarx::skills::provider::SkillProviderExample::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: SkillProviderExample.cpp:25
SkillProviderExample.h
armarx::skills::provider::SkillProviderExample::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: SkillProviderExample.cpp:94
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition: SkillDescription.h:19
armarx::skills::provider::SkillProviderExample::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: SkillProviderExample.cpp:11
armarx::SkillProviderComponentPluginUser::addSkillFactory
skills::SkillBlueprint * addSkillFactory(const skills::SkillDescription &desc, const skills::LambdaSkill::FunctionType &f)
Definition: SkillProviderComponentPlugin.h:161
armarx::skills::provider
Definition: BusyWaiting.cpp:6
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
armarx::skills::provider::SkillProviderExample::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: SkillProviderExample.cpp:104
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:181
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::skills::provider::SkillProviderExample::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: SkillProviderExample.cpp:99
armarx::skills::provider::SkillProviderExample::getDefaultName
std::string getDefaultName() const override
Definition: SkillProviderExample.cpp:19
armarx::skills::SkillID
Definition: SkillID.h:14
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition: Duration.cpp:48