ChainingAsync.cpp
Go to the documentation of this file.
1
#include "
ChainingAsync.h
"
2
3
namespace
armarx::skills::provider
4
{
5
6
ChainingAsyncSkill::ChainingAsyncSkill
() :
SimpleSkill
(GetSkillDescription())
7
{
8
}
9
10
SkillDescription
11
ChainingAsyncSkill::GetSkillDescription
()
12
{
13
return
SkillDescription
{.
skillId
=
armarx::skills::SkillID
{.
skillName
=
"ChainingAsync"
},
14
.description =
15
"This skill calls the Timeout skill several times async."
,
16
17
.rootProfileDefaults =
armarx::aron::make_dict
(),
18
.timeout =
armarx::core::time::Duration::MilliSeconds
(5000)};
19
}
20
21
Skill::MainResult
22
ChainingAsyncSkill::main
(
const
MainInput& in)
23
{
24
SkillProxy
prx(
25
manager
,
26
skills::SkillID
{.
providerId
= *
getSkillId
().
providerId
, .skillName =
"Timeout"
});
27
28
for
(
int
i = 0; i < 25; i++)
29
{
30
this->
throwIfSkillShouldTerminate
();
31
32
ARMARX_INFO
<<
"Call subskill number "
<< i;
33
callSubskillAsync
(prx);
// Call the Timeout skill
34
}
35
36
this->
throwIfSkillShouldTerminate
();
37
38
return
{
TerminatedSkillStatus::Succeeded
,
nullptr
};
39
}
40
}
// namespace armarx::skills::provider
armarx::skills::Skill::manager
manager::dti::SkillManagerInterfacePrx manager
Definition:
Skill.h:291
armarx::skills::TerminatedSkillStatus::Succeeded
@ Succeeded
armarx::skills::provider::ChainingAsyncSkill::GetSkillDescription
static SkillDescription GetSkillDescription()
Definition:
ChainingAsync.cpp:11
armarx::aron::make_dict
aron::data::DictPtr make_dict(_Args &&... args)
Definition:
Dict.h:107
armarx::skills::SkillID::skillName
std::string skillName
Definition:
SkillID.h:41
armarx::skills::SkillDescription
Definition:
SkillDescription.h:17
armarx::skills::SkillID::providerId
std::optional< ProviderID > providerId
Definition:
SkillID.h:40
armarx::skills::Skill::callSubskillAsync
skills::SkillExecutionID callSubskillAsync(const skills::SkillProxy &proxy)
Similar to callSubskill but non-blocking.
Definition:
Skill.cpp:52
ChainingAsync.h
armarx::skills::SkillProxy
Definition:
SkillProxy.h:13
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition:
SkillDescription.h:19
armarx::skills::provider
Definition:
BusyWaiting.cpp:6
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition:
Skill.h:39
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_INFO
#define ARMARX_INFO
Definition:
Logging.h:181
armarx::skills::provider::ChainingAsyncSkill::ChainingAsyncSkill
ChainingAsyncSkill()
Definition:
ChainingAsync.cpp:6
armarx::skills::Skill::throwIfSkillShouldTerminate
void throwIfSkillShouldTerminate(const std::string &abortedMessage="")
Definition:
Skill.cpp:305
armarx::skills::SkillID
Definition:
SkillID.h:14
armarx::skills::Skill::getSkillId
SkillID getSkillId() const
Get the id of the skill.
Definition:
Skill.cpp:497
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition:
Duration.cpp:48
RobotAPI
components
skills
SkillProviderExample
ChainingAsync.cpp
Generated on Sat Mar 29 2025 09:17:26 for armarx_documentation by
1.8.17