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
15
18 {
20 return SkillDescription{.skillId = {.skillName = "Incomplete"},
21 .description = d.description,
22 .rootProfileDefaults = armarx::aron::make_dict(),
23 .timeout = d.timeout + armarx::core::time::Duration::Seconds(2),
24 .parametersType = d.parametersType};
25 }
26
28 IncompleteSkill::prepare()
29 {
30 if (!first_prepared)
31 {
32 first_prepared = true;
33
34 // set parameters after two seconds...
35 std::thread foo(
36 [&]()
37 {
39 std::this_thread::sleep_for(std::chrono::milliseconds(2000));
40 this->setParameters(d.rootProfileDefaults);
41 });
42 foo.detach();
43 }
44
46 }
47
48 Skill::MainResult
49 IncompleteSkill::main(const MainInput& in)
50 {
51 auto s = HelloWorldSkill();
52 return s.mainOfSkill();
53 }
54} // namespace armarx::skills::provider
static Duration Seconds(std::int64_t seconds)
Constructs a duration in seconds.
Definition Duration.cpp:72
virtual MainResult main()
Override this method with the actual implementation.
Definition Skill.cpp:542
void setParameters(const aron::data::DictPtr &d)
Hard set the parameters, ignoring everything that has been set or merged before.
Definition Skill.cpp:206
static SkillDescription GetSkillDescription()
static SkillDescription GetSkillDescription()
aron::data::DictPtr make_dict(_Args &&... args)
Definition Dict.h:107
double s(double t, double s0, double v0, double a0, double j)
Definition CtrlUtil.h:33
A result struct for skill preparing.
Definition Skill.h:56