Timeout.cpp
Go to the documentation of this file.
1
2
#include "
Timeout.h
"
3
4
namespace
armarx::skills::provider
5
{
6
7
TimeoutSkill::TimeoutSkill
() :
8
PeriodicSkill
(GetSkillDescription(),
armarx
::core::time::
Frequency
::Hertz(5))
9
{
10
}
11
12
SkillDescription
13
TimeoutSkill::GetSkillDescription
()
14
{
15
return
SkillDescription
{.
skillId
=
SkillID
{.
skillName
=
"Timeout"
},
16
.description =
"This fails with timeout reached"
,
17
.timeout =
armarx::core::time::Duration::MilliSeconds
(2000)};
18
}
19
20
PeriodicSkill::StepResult
21
TimeoutSkill::step()
22
{
23
// do heavy work
24
std::this_thread::sleep_for(std::chrono::milliseconds(50));
25
26
return
{
ActiveOrTerminatedSkillStatus::Running
,
nullptr
};
27
}
28
}
// namespace armarx::skills::provider
armarx::skills::provider::TimeoutSkill::GetSkillDescription
static SkillDescription GetSkillDescription()
Definition:
Timeout.cpp:13
armarx::skills::SkillID::skillName
std::string skillName
Definition:
SkillID.h:60
armarx::skills::PeriodicSkill
Definition:
PeriodicSkill.h:33
armarx::skills::SkillDescription
Definition:
SkillDescription.h:18
armarx::core::time::Frequency
Represents a frequency.
Definition:
Frequency.h:17
armarx::skills::provider::TimeoutSkill::TimeoutSkill
TimeoutSkill()
Definition:
Timeout.cpp:7
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition:
SkillDescription.h:20
armarx::skills::provider
Definition:
BusyWaiting.cpp:6
armarx::skills::ActiveOrTerminatedSkillStatus::Running
@ Running
Timeout.h
armarx::skills::SkillID
Definition:
SkillID.h:17
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition:
ArmarXTimeserver.cpp:28
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition:
Duration.cpp:55
armarx::skills::PeriodicSkill::StepResult
Definition:
PeriodicSkill.h:36
RobotAPI
components
skills
SkillProviderExample
Timeout.cpp
Generated on Sat Oct 12 2024 09:14:06 for armarx_documentation by
1.8.17