SimpleSkill.cpp
Go to the documentation of this file.
1 #include "SimpleSkill.h"
2 
3 namespace armarx::skills
4 {
5  Skill::InitResult
7  {
8  InitInput i;
9  i.executorName = this->executorName;
10  i.parameters = this->parameters;
11  return this->init(i);
12  }
13 
16  {
17  MainInput i;
18  i.executorName = this->executorName;
19  i.parameters = this->parameters;
20  i.callback = this->callback;
21  return this->main(i);
22  }
23 
26  {
27  ExitInput i;
28  i.executorName = this->executorName;
29  i.parameters = this->parameters;
30  return this->exit(i);
31  }
32 
35  {
36  // Default nothing to init
38  }
39 
42  {
43  // This is just a dummy implementation
44  ARMARX_IMPORTANT << "Dummy executing skill '" << description.skillId
45  << "'. Please overwrite this method.";
46  return {.status = TerminatedSkillStatus::Succeeded, .data = nullptr};
47  }
48 
51  {
52  // Default nothing to exit
54  }
55 } // namespace armarx::skills
armarx::skills::Skill::ExitResult::status
TerminatedSkillStatus status
Definition: Skill.h:57
armarx::skills::SimpleSkill::ExitInput::executorName
std::string executorName
Definition: SimpleSkill.h:31
armarx::skills::TerminatedSkillStatus::Succeeded
@ Succeeded
armarx::skills::SimpleSkill::ExitInput::parameters
aron::data::DictPtr parameters
Definition: SimpleSkill.h:32
armarx::skills::SimpleSkill::MainInput::executorName
std::string executorName
Definition: SimpleSkill.h:24
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition: Logging.h:183
armarx::skills::SimpleSkill::MainInput::parameters
aron::data::DictPtr parameters
Definition: SimpleSkill.h:25
armarx::skills
This file is part of ArmarX.
Definition: PeriodicUpdateWidget.cpp:11
armarx::skills::Skill::parameters
armarx::aron::data::DictPtr parameters
Definition: Skill.h:333
armarx::skills::SimpleSkill::MainInput
Definition: SimpleSkill.h:22
armarx::skills::SimpleSkill::MainInput::callback
CallbackT callback
Definition: SimpleSkill.h:26
armarx::skills::SimpleSkill::exit
ExitResult exit() final
Override this method with the actual implementation.
Definition: SimpleSkill.cpp:25
armarx::skills::SimpleSkill::InitInput::executorName
std::string executorName
Definition: SimpleSkill.h:18
armarx::skills::SimpleSkill::ExitInput
Definition: SimpleSkill.h:29
armarx::skills::SimpleSkill::InitInput::parameters
aron::data::DictPtr parameters
Definition: SimpleSkill.h:19
armarx::skills::Skill::description
SkillDescription description
Definition: Skill.h:336
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition: SkillDescription.h:20
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition: Skill.h:48
SimpleSkill.h
armarx::skills::Skill::ExitResult
A result struct for skill exit function.
Definition: Skill.h:55
armarx::skills::Skill::executorName
std::string executorName
Definition: Skill.h:328
armarx::skills::Skill::callback
CallbackT callback
Definition: Skill.h:326
armarx::skills::SimpleSkill::main
MainResult main() final
Override this method with the actual implementation. The callback is for status updates to the callin...
Definition: SimpleSkill.cpp:15
armarx::skills::SimpleSkill::init
InitResult init() final
Override this method with the actual implementation.
Definition: SimpleSkill.cpp:6
armarx::skills::Skill::InitResult::status
TerminatedSkillStatus status
Definition: Skill.h:38
armarx::skills::Skill::InitResult
A result struct for skill initialization.
Definition: Skill.h:36
armarx::skills::SimpleSkill::InitInput
Definition: SimpleSkill.h:16