BusyWaiting.cpp
Go to the documentation of this file.
1
#include "
BusyWaiting.h
"
2
3
#include <chrono>
4
#include <thread>
5
6
namespace
armarx::skills::provider
7
{
8
9
BusyWaitingSkill::BusyWaitingSkill
() :
SimpleSkill
(GetSkillDescription())
10
{
11
}
12
13
SkillDescription
14
BusyWaitingSkill::GetSkillDescription
()
15
{
16
return
SkillDescription
{.
skillId
=
SkillID
{.
skillName
=
"BusyWaiting"
},
17
.description =
"This skill takes two seconds"
,
18
.timeout =
armarx::core::time::Duration::MilliSeconds
(10000)};
19
}
20
21
Skill::MainResult
22
BusyWaitingSkill::main
(
const
MainInput& in)
23
{
24
for
(
unsigned
int
i = 0; i < 10; i++)
25
{
26
throwIfSkillShouldTerminate
();
27
std::this_thread::sleep_for(std::chrono::milliseconds(200));
28
}
29
30
return
{
TerminatedSkillStatus::Succeeded
,
nullptr
};
31
}
32
}
// namespace armarx::skills::provider
BusyWaiting.h
armarx::skills::TerminatedSkillStatus::Succeeded
@ Succeeded
armarx::skills::SkillID::skillName
std::string skillName
Definition:
SkillID.h:60
armarx::skills::SkillDescription
Definition:
SkillDescription.h:18
armarx::skills::provider::BusyWaitingSkill::BusyWaitingSkill
BusyWaitingSkill()
Definition:
BusyWaiting.cpp:9
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition:
SkillDescription.h:20
armarx::skills::provider
Definition:
BusyWaiting.cpp:6
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition:
Skill.h:48
armarx::skills::SimpleSkill
Definition:
SimpleSkill.h:9
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::provider::BusyWaitingSkill::GetSkillDescription
static SkillDescription GetSkillDescription()
Definition:
BusyWaiting.cpp:14
armarx::skills::Skill::throwIfSkillShouldTerminate
void throwIfSkillShouldTerminate(const std::string &abortedMessage="")
Definition:
Skill.cpp:291
armarx::skills::SkillID
Definition:
SkillID.h:17
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition:
Duration.cpp:55
RobotAPI
components
skills
SkillProviderExample
BusyWaiting.cpp
Generated on Sat Oct 12 2024 09:14:06 for armarx_documentation by
1.8.17