ZeroPose.cpp
Go to the documentation of this file.
1
#include "
ZeroPose.h
"
2
3
#include <
RobotAPI/libraries/skills/provider/SpecializedSkillProxy.h
>
4
5
#include <armarx/control/skills/aron/MoveJointsToNamedConfigurationParams.aron.generated.h>
6
#include <
armarx/control/skills/constants/constants.h
>
7
#include <
armarx/control/skills/skills/param_conversions.h
>
8
9
namespace
armarx::control::skills::skills::meta
10
{
11
12
ZeroPose::ZeroPose
() : SimpleSpecializedSkill(GetSkillDescription())
13
{
14
}
15
16
armarx::skills::SkillDescription
17
ZeroPose::GetSkillDescription
()
18
{
19
ParamType
defaultParams;
20
21
std::stringstream desc;
22
desc <<
"Move all joints to zero (except joints which would cause a self collision)."
23
<<
"\n\n"
24
<<
"The `enable*` parameters can be used to enable/disable movement for different "
25
"body parts of the robot."
;
26
27
return
armarx::skills::SkillDescription
{
28
.
skillId
= {.
skillName
=
constants::ZERO_POSE_SKILL_NAME
},
29
.description = desc.str(),
30
.rootProfileDefaults = defaultParams.toAron(),
31
.timeout =
::armarx::Duration::Seconds
(30),
32
.parametersType = ParamType::ToAronType(),
33
};
34
}
35
36
::armarx::skills::Skill::MainResult
37
ZeroPose::main
(
const
SpecializedMainInput& in)
38
{
39
auto
moveToConfiguration =
armarx::skills::SpecializedSkillProxy
<
40
armarx::control::skills::arondto::MoveJointsToNamedConfigurationParams>(
41
this->
manager
,
42
::armarx::skills::SkillID
{
43
.
providerId
=
getSkillId
().
providerId
,
44
.skillName =
constants::MOVE_JOINTS_TO_NAMED_CONFIGURATION_SKILL_NAME
,
45
});
46
auto
subParams = moveToConfiguration.
getRootProfileParameters
();
47
48
subParams.configuration =
"Zero"
;
49
copy_params
(in.parameters, subParams);
50
51
this->
callSubskill
(moveToConfiguration, subParams.toAron());
52
53
return
MakeSucceededResult
();
54
}
55
56
}
// namespace armarx::control::skills::skills::meta
armarx::skills::Skill::manager
manager::dti::SkillManagerInterfacePrx manager
Definition:
Skill.h:327
armarx::skills::SimpleSpecializedSkill< arondto::NamedConfigurationParams >::ParamType
arondto::NamedConfigurationParams ParamType
Definition:
SimpleSpecializedSkill.h:14
SpecializedSkillProxy.h
armarx::skills::SkillID::skillName
std::string skillName
Definition:
SkillID.h:60
param_conversions.h
armarx::skills::SkillDescription
Definition:
SkillDescription.h:18
armarx::control::skills::skills::meta::ZeroPose::GetSkillDescription
::armarx::skills::SkillDescription GetSkillDescription()
Definition:
ZeroPose.cpp:17
armarx::skills::SkillID::providerId
std::optional< ProviderID > providerId
Definition:
SkillID.h:59
armarx::skills::SpecializedSkillProxy::getRootProfileParameters
AronT getRootProfileParameters()
Definition:
SpecializedSkillProxy.h:30
armarx::skills::Skill::callSubskill
std::optional< TerminatedSkillStatusUpdate > callSubskill(const skills::SkillProxy &proxy)
Call a subskill with default parameters and block until the subskill terminates.
Definition:
Skill.cpp:22
armarx::control::skills::skills::copy_params
void copy_params(const arondto::MoveJointsParams &from, arondto::MoveJointsToPositionParams &to)
Definition:
param_conversions.h:12
constants.h
armarx::core::time::Duration::Seconds
static Duration Seconds(std::int64_t seconds)
Constructs a duration in seconds.
Definition:
Duration.cpp:83
armarx::skills::SpecializedSkillProxy
Definition:
SpecializedSkillProxy.h:10
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition:
SkillDescription.h:20
armarx::skills::Skill::MakeSucceededResult
static MainResult MakeSucceededResult(aron::data::DictPtr data=nullptr)
Definition:
Skill.cpp:315
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition:
Skill.h:48
ZeroPose.h
armarx::skills::SimpleSpecializedSkill< arondto::NamedConfigurationParams >::main
Skill::MainResult main() final
Definition:
SimpleSpecializedSkill.h:71
armarx::control::skills::constants::ZERO_POSE_SKILL_NAME
std::string ZERO_POSE_SKILL_NAME
Definition:
constants.cpp:17
armarx::control::skills::constants::MOVE_JOINTS_TO_NAMED_CONFIGURATION_SKILL_NAME
std::string MOVE_JOINTS_TO_NAMED_CONFIGURATION_SKILL_NAME
Definition:
constants.cpp:10
armarx::control::skills::skills::meta
Definition:
HomePose.cpp:12
armarx::skills::SkillID
Definition:
SkillID.h:17
armarx::control::skills::skills::meta::ZeroPose::ZeroPose
ZeroPose()
Definition:
ZeroPose.cpp:12
armarx::skills::Skill::getSkillId
SkillID getSkillId() const
Get the id of the skill.
Definition:
Skill.h:74
armarx
control
skills
skills
meta
ZeroPose.cpp
Generated on Sat Oct 12 2024 09:14:15 for armarx_documentation by
1.8.17