ConfigurableExitStatus.cpp
Go to the documentation of this file.
1
2
4
8
10{
15
18 {
19 armarx::skills::Example::DataPassingParams root_profile_params;
20 root_profile_params.have_success = true; //by default the skill will succeed
21 std::string des =
22 "This skill terminates with success if the 'have_success' parameter is true; "
23 "otherwise, it fails. Regardless of the outcome, it returns a constant integer "
24 "with the value 1234. This skill is primarily used by 'SkillReturnDataProcessing' "
25 "to demonstrate how data can be passed upon termination.";
26 return SkillDescription{
27 .skillId = skills::SkillID{.skillName = "ConfigurableExitStatus"},
28 .description = des,
29 .rootProfileDefaults = root_profile_params.toAron(),
31 .parametersType = armarx::skills::Example::DataPassingParams::ToAronType(),
32 .resultType = armarx::skills::Example::DataPassingReturn::ToAronType()};
33 }
34
36 ConfigurableExitStatus::main(const SpecializedMainInput& in)
37 {
38 ARMARX_IMPORTANT << "Hi, from the ConfigurableExitStatus skill.\n";
39 ARMARX_IMPORTANT << "The exit status is set to: have success: "
40 << in.parameters.have_success;
41
43 if (in.parameters.have_success)
44 {
45 // skill will succeed
47 }
48 else
49 {
50 // skill will fail
52 }
53 // define output value
54 armarx::skills::Example::DataPassingReturn out;
55 out.some_return_int = 1234;
56
57 return {.status = status, .data = out.toAron()};
58 }
59} // namespace armarx::skills::provider
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition Duration.cpp:48
virtual MainResult main()
Override this method with the actual implementation.
Definition Skill.cpp:542
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
Definition Logging.h:190
This file is part of ArmarX.
A result struct for th main method of a skill.
Definition Skill.h:62