SimpleSpecializedSkill.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
RobotAPI/libraries/skills/provider/SpecializedSkill.h
>
4
5
namespace
armarx
6
{
7
namespace
skills
8
{
9
template
<
class
AronT>
10
class
SimpleSpecializedSkill
:
public
SpecializedSkill
<AronT>
11
{
12
public
:
13
using
Base
=
SpecializedSkill<AronT>
;
14
using
ParamType
= AronT;
15
16
using
Base::Base
;
17
18
struct
SpecializedInitInput
19
{
20
std::string
executorName
;
21
AronT
parameters
;
22
};
23
24
struct
SpecializedMainInput
25
{
26
std::string
executorName
;
27
AronT
parameters
;
28
Skill::CallbackT
callback
;
29
};
30
31
struct
SpecializedExitInput
32
{
33
std::string
executorName
;
34
AronT
parameters
;
35
};
36
37
38
protected
:
39
// legacy methods
40
virtual
Skill::InitResult
41
init
(
const
SpecializedInitInput& in)
42
{
43
return
Skill::InitResult
{.
status
=
TerminatedSkillStatus::Succeeded
};
44
}
45
46
virtual
Skill::MainResult
47
main
(
const
SpecializedMainInput& in)
48
{
49
ARMARX_IMPORTANT
<<
"Dummy executing skill '"
<< this->
description
.
skillId
50
<<
"'. Please overwrite this method."
;
51
return
Skill::MainResult
{.
status
=
TerminatedSkillStatus::Succeeded
,
52
.data =
nullptr
};
53
}
54
55
virtual
Skill::ExitResult
56
exit
(
const
SpecializedExitInput& in)
57
{
58
return
Skill::ExitResult
{.
status
=
TerminatedSkillStatus::Succeeded
};
59
}
60
61
Skill::InitResult
62
init
() final
63
{
64
SpecializedInitInput i;
65
i.executorName = this->
executorName
;
66
i.parameters = this->
getParameters
();
67
return
this->
init
(i);
68
}
69
70
Skill::MainResult
71
main
() final
72
{
73
SpecializedMainInput i;
74
i.executorName = this->
executorName
;
75
i.callback = this->
callback
;
76
i.parameters = this->
getParameters
();
77
return
this->
main
(i);
78
}
79
80
Skill::ExitResult
81
exit
() final
82
{
83
SpecializedExitInput i;
84
i.executorName = this->
executorName
;
85
i.parameters = this->
getParameters
();
86
return
this->
exit
(i);
87
}
88
};
89
}
// namespace skills
90
}
// namespace armarx
armarx::skills::Skill::ExitResult::status
TerminatedSkillStatus status
Definition:
Skill.h:57
armarx::skills::SimpleSpecializedSkill::init
Skill::InitResult init() final
Override this method with the actual implementation.
Definition:
SimpleSpecializedSkill.h:62
armarx::skills::SpecializedSkill
Definition:
SpecializedSkill.h:14
armarx::skills::TerminatedSkillStatus::Succeeded
@ Succeeded
skills
This file is part of ArmarX.
armarx::skills::SimpleSpecializedSkill< arondto::NamedConfigurationParams >::ParamType
arondto::NamedConfigurationParams ParamType
Definition:
SimpleSpecializedSkill.h:14
ARMARX_IMPORTANT
#define ARMARX_IMPORTANT
Definition:
Logging.h:183
armarx::skills::SimpleSpecializedSkill::SpecializedMainInput::callback
Skill::CallbackT callback
Definition:
SimpleSpecializedSkill.h:28
armarx::skills::Skill::CallbackT
std::function< void(const SkillStatus s, const armarx::aron::data::DictPtr &)> CallbackT
Definition:
Skill.h:33
armarx::skills::SpecializedSkill::getParameters
AronT getParameters() const
Overwrite getter for parameters. Shadow Skill::getParameters()
Definition:
SpecializedSkill.h:31
armarx::skills::SimpleSpecializedSkill::exit
Skill::ExitResult exit() final
Override this method with the actual implementation.
Definition:
SimpleSpecializedSkill.h:81
armarx::skills::SimpleSpecializedSkill::SpecializedMainInput
Definition:
SimpleSpecializedSkill.h:24
armarx::skills::SimpleSpecializedSkill::SpecializedInitInput::parameters
AronT parameters
Definition:
SimpleSpecializedSkill.h:21
armarx::skills::SimpleSpecializedSkill::init
virtual Skill::InitResult init(const SpecializedInitInput &in)
Definition:
SimpleSpecializedSkill.h:41
armarx::skills::Skill::description
SkillDescription description
Definition:
Skill.h:336
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition:
SkillDescription.h:20
armarx::skills::SimpleSpecializedSkill
Definition:
SimpleSpecializedSkill.h:10
armarx::skills::SimpleSpecializedSkill::SpecializedInitInput::executorName
std::string executorName
Definition:
SimpleSpecializedSkill.h:20
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition:
Skill.h:48
armarx::skills::Skill::ExitResult
A result struct for skill exit function.
Definition:
Skill.h:55
armarx::skills::Skill::executorName
std::string executorName
Definition:
Skill.h:328
armarx::skills::Skill::callback
CallbackT callback
Definition:
Skill.h:326
armarx::skills::SimpleSpecializedSkill::SpecializedMainInput::parameters
AronT parameters
Definition:
SimpleSpecializedSkill.h:27
armarx::skills::Skill::MainResult::status
TerminatedSkillStatus status
Definition:
Skill.h:50
armarx::skills::SimpleSpecializedSkill::SpecializedInitInput
Definition:
SimpleSpecializedSkill.h:18
armarx::skills::SimpleSpecializedSkill::main
Skill::MainResult main() final
Override this method with the actual implementation. The callback is for status updates to the callin...
Definition:
SimpleSpecializedSkill.h:71
armarx::skills::Skill::InitResult::status
TerminatedSkillStatus status
Definition:
Skill.h:38
armarx::skills::Skill::InitResult
A result struct for skill initialization.
Definition:
Skill.h:36
SpecializedSkill.h
armarx::skills::SimpleSpecializedSkill::SpecializedExitInput
Definition:
SimpleSpecializedSkill.h:31
armarx::skills::SimpleSpecializedSkill::SpecializedMainInput::executorName
std::string executorName
Definition:
SimpleSpecializedSkill.h:26
armarx::skills::SimpleSpecializedSkill::exit
virtual Skill::ExitResult exit(const SpecializedExitInput &in)
Definition:
SimpleSpecializedSkill.h:56
armarx::skills::SpecializedSkill::Base
Skill Base
Definition:
SpecializedSkill.h:17
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition:
ArmarXTimeserver.cpp:28
armarx::skills::SimpleSpecializedSkill::SpecializedExitInput::executorName
std::string executorName
Definition:
SimpleSpecializedSkill.h:33
armarx::skills::SimpleSpecializedSkill::main
virtual Skill::MainResult main(const SpecializedMainInput &in)
Definition:
SimpleSpecializedSkill.h:47
armarx::skills::SimpleSpecializedSkill::SpecializedExitInput::parameters
AronT parameters
Definition:
SimpleSpecializedSkill.h:34
RobotAPI
libraries
skills
provider
SimpleSpecializedSkill.h
Generated on Sat Oct 12 2024 09:14:12 for armarx_documentation by
1.8.17