PointAt.cpp
Go to the documentation of this file.
1
#include "
PointAt.h
"
2
3
#include <
armarx/control/pointing/skill_ids/skill_ids.h
>
4
5
#include "
aron_conversions.h
"
6
7
namespace
armarx::control::pointing::skills
8
{
9
10
armarx::skills::SkillDescription
11
PointAt::GetSkillDescription
()
12
{
13
ParamType
defaultParams;
14
defaultParams.side =
core::Side::RIGHT
;
15
defaultParams.target.header.frame =
armarx::GlobalFrame
;
16
defaultParams.handShape = std::make_optional(
"Pointing"
);
17
defaultParams.maxVelocity = 0.4;
18
defaultParams.maxAcceleration = 0.3;
19
20
return
armarx::skills::SkillDescription
{.
skillId
=
skill_ids::POINT_AT
,
21
.description =
"Lets the robot point at something."
,
22
.rootProfileDefaults = defaultParams.toAron(),
23
.timeout =
armarx::core::time::Duration::Minutes
(1),
24
.parametersType = ParamType::ToAronType()};
25
}
26
27
PointAt::PointAt
(
const
Remote
& remote) :
Base
(GetSkillDescription()), remote_(remote)
28
{
29
}
30
31
PointAt::MainResult
32
PointAt::main
(
const
SpecializedMainInput& in)
33
{
34
core::Pointing::Parameters
parameters
=
fromAron
(in.parameters);
35
impl_.emplace(remote_);
36
try
37
{
38
impl_->execute(
parameters
);
39
}
40
catch
(
armarx::exceptions::local::PointingFailedException
&)
41
{
42
return
MakeFailedResult
();
43
}
44
catch
(
armarx::exceptions::local::PointingAbortedException
&)
45
{
46
return
MakeAbortedResult
();
47
}
48
return
MakeSucceededResult
();
49
}
50
51
void
52
PointAt::onStopRequested
()
53
{
54
impl_->abort();
55
}
56
57
void
58
PointAt::onTimeoutReached
()
59
{
60
impl_->abort();
61
}
62
63
}
// namespace armarx::control::pointing::skills
armarx::control::pointing::skills
Definition:
aron_conversions.h:7
armarx::control::pointing::core::RIGHT
@ RIGHT
Definition:
Side.h:13
armarx::control::pointing::core::Pointing::Parameters
Definition:
Pointing.h:50
armarx::skills::SimpleSpecializedSkill< arondto::PointAtParams >::ParamType
arondto::PointAtParams ParamType
Definition:
SimpleSpecializedSkill.h:14
armarx::skills::Skill::parameters
armarx::aron::data::DictPtr parameters
Definition:
Skill.h:333
armarx::skills::SkillDescription
Definition:
SkillDescription.h:18
armarx::GlobalFrame
const std::string GlobalFrame
Definition:
FramedPose.h:62
PointAt.h
armarx::control::pointing::skills::PointAt::onTimeoutReached
void onTimeoutReached() override
Override these methods if you want to do something special when notification comes.
Definition:
PointAt.cpp:58
armarx::skills::Skill::MakeFailedResult
static MainResult MakeFailedResult()
Definition:
Skill.cpp:324
skill_ids.h
armarx::skills::SkillDescription::skillId
SkillID skillId
Definition:
SkillDescription.h:20
armarx::skills::SimpleSpecializedSkill< arondto::PointAtParams >
armarx::skills::Skill::MakeAbortedResult
static MainResult MakeAbortedResult()
Definition:
Skill.cpp:333
armarx::core::time::Duration::Minutes
static Duration Minutes(std::int64_t minutes)
Constructs a duration in minutes.
Definition:
Duration.cpp:111
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
armarx::skills::SimpleSpecializedSkill< arondto::PointAtParams >::main
Skill::MainResult main() final
Definition:
SimpleSpecializedSkill.h:71
armarx::control::pointing::skills::PointAt::onStopRequested
void onStopRequested() override
Definition:
PointAt.cpp:52
armarx::control::pointing::skills::PointAt::GetSkillDescription
static armarx::skills::SkillDescription GetSkillDescription()
Definition:
PointAt.cpp:11
armarx::exceptions::local::PointingFailedException
Definition:
Pointing.h:19
armarx::exceptions::local::PointingAbortedException
Definition:
Pointing.h:23
armarx::control::pointing::skill_ids::POINT_AT
const armarx::skills::SkillID POINT_AT
Definition:
skill_ids.cpp:7
armarx::control::pointing::skills::PointAt::PointAt
PointAt(const Remote &)
Definition:
PointAt.cpp:27
armarx::control::pointing::core::Pointing::Remote
Definition:
Pointing.h:42
armarx::control::pointing::skills::fromAron
void fromAron(const arondto::Side &dto, core::Side &bo)
Definition:
aron_conversions.cpp:8
aron_conversions.h
armarx
control
pointing
skills
PointAt.cpp
Generated on Sat Oct 12 2024 09:14:15 for armarx_documentation by
1.8.17