Incomplete.cpp
Go to the documentation of this file.
1 
2 
3 #include "Incomplete.h"
4 
5 #include <RobotAPI/components/skills/SkillProviderExample/aron/HelloWorldAcceptedType.aron.generated.h>
6 
7 #include "HelloWorld.h"
8 
10 {
11 
12  IncompleteSkill::IncompleteSkill() : SimpleSkill(GetSkillDescription())
13  {
14  }
15 
18  {
20  return SkillDescription{.skillId = {.skillName = "Incomplete"},
21  .description = d.description,
22  .timeout = d.timeout + armarx::core::time::Duration::Seconds(2),
23  .parametersType = d.parametersType};
24  }
25 
27  IncompleteSkill::prepare()
28  {
29  if (!first_prepared)
30  {
31  first_prepared = true;
32 
33  // set parameters after two seconds...
34  std::thread foo(
35  [&]()
36  {
38  std::this_thread::sleep_for(std::chrono::milliseconds(2000));
39  this->setParameters(d.rootProfileDefaults);
40  });
41  foo.detach();
42  }
43 
45  }
46 
47  Skill::MainResult
48  IncompleteSkill::main(const MainInput& in)
49  {
50  auto s = HelloWorldSkill();
51  return s.mainOfSkill();
52  }
53 } // namespace armarx::skills::provider
armarx::skills::Skill::setParameters
void setParameters(const aron::data::DictPtr &d)
Hard set the parameters, ignoring everything that has been set or merged before.
Definition: Skill.cpp:108
armarx::skills::ActiveOrTerminatedSkillStatus::Succeeded
@ Succeeded
armarx::skills::Skill::PrepareResult
A result struct for skill preparing.
Definition: Skill.h:42
armarx::skills::SkillID::skillName
std::string skillName
Definition: SkillID.h:60
armarx::skills::SkillDescription
Definition: SkillDescription.h:18
armarx::skills::provider::IncompleteSkill::GetSkillDescription
static SkillDescription GetSkillDescription()
Definition: Incomplete.cpp:17
HelloWorld.h
armarx::core::time::Duration::Seconds
static Duration Seconds(std::int64_t seconds)
Constructs a duration in seconds.
Definition: Duration.cpp:83
Incomplete.h
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition: SkillDescription.h:20
armarx::skills::provider
Definition: BusyWaiting.cpp:6
armarx::skills::SimpleSkill
Definition: SimpleSkill.h:9
armarx::skills::provider::IncompleteSkill::IncompleteSkill
IncompleteSkill()
Definition: Incomplete.cpp:12
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::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx::skills::provider::HelloWorldSkill::GetSkillDescription
static SkillDescription GetSkillDescription()
Definition: HelloWorld.cpp:17