CreateHumanPose.cpp
Go to the documentation of this file.
1
/*
2
* This file is part of ArmarX.
3
*
4
* ArmarX is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation.
7
*
8
* ArmarX is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* @package VisionX::COMPONENT_NAME_SNAKE::skills
17
* @author Peter Albrecht ( usnlf at student dot kit dot edu)
18
* @date 2024
19
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20
* GNU General Public License
21
*/
22
23
#include "
CreateHumanPose.h
"
24
25
#include "
VisionX/libraries/person_simulator/core/PersonSimulator.h
"
26
#include "
VisionX/libraries/person_simulator/skills/constants.h
"
27
#include "
VisionX/libraries/person_simulator/skills/skill_ids.h
"
28
29
namespace
VisionX::person_simulator::skills
30
{
31
32
::armarx::skills::SkillDescription
33
CreateHumanPose::GetSkillDescription
()
34
{
35
ParamType
defaultParams;
36
defaultParams.humanId =
"0"
;
37
defaultParams.orientationDegreesClockwise = 0.F;
38
defaultParams.orientationFacesRobot =
true
;
39
// we explicitly do not set the default position!
40
41
const
std::string skillName =
VisionX::person_simulator::skills::constants::CreateHumanPose
;
42
const
armarx::skills::SkillID
skillId =
43
VisionX::person_simulator::skills::skill_ids::CreateHumanPose
;
44
45
return ::armarx::skills::SkillDescription{
46
.skillId = skillId,
47
.description =
"Creates and commits a human pose. Optionally, the pose can be set to "
48
"face the robot."
,
49
.rootProfileDefaults = defaultParams.toAron(),
50
.timeout =
::armarx::Duration::MilliSeconds
(1000),
51
.parametersType = ParamType::ToAronType()};
52
}
53
54
CreateHumanPose::CreateHumanPose
(
const
core::PersonSimulator::Remote
& r,
55
const
core::PersonSimulator::Properties
& p) :
56
Base
(GetSkillDescription()), remote(r), properties(p)
57
{
58
}
59
60
CreateHumanPose::MainResult
61
CreateHumanPose::main
(
const
SpecializedMainInput& in)
62
{
63
core::PersonSimulator
simulator(remote, properties);
64
if
(in.parameters.orientationFacesRobot)
65
{
66
simulator.createHumanPoseFacingRobot(in.parameters.humanId,
67
in.parameters.positionCartesian);
68
}
69
else
70
{
71
simulator.createHumanPose(in.parameters.humanId,
72
in.parameters.positionCartesian,
73
in.parameters.orientationDegreesClockwise);
74
}
75
return
Skill::MakeSucceededResult();
76
}
77
78
}
// namespace VisionX::person_simulator::skills
VisionX::person_simulator::skills::CreateHumanPose::GetSkillDescription
::armarx::skills::SkillDescription GetSkillDescription()
Definition:
CreateHumanPose.cpp:33
VisionX::person_simulator::skills::CreateHumanPose::CreateHumanPose
CreateHumanPose(const core::PersonSimulator::Remote &r, const core::PersonSimulator::Properties &p)
Definition:
CreateHumanPose.cpp:54
armarx::skills::SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >::ParamType
::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams ParamType
Definition:
SimpleSpecializedSkill.h:14
VisionX::person_simulator::skills::constants::CreateHumanPose
const std::string CreateHumanPose
Definition:
constants.h:32
armarx::skills::SkillDescription
Definition:
SkillDescription.h:17
PersonSimulator.h
constants.h
VisionX::person_simulator::skills
Definition:
constants.h:28
VisionX::person_simulator::core::PersonSimulator::Properties
Fixed properties of this skill implementation.
Definition:
PersonSimulator.h:56
skill_ids.h
VisionX::person_simulator::core::PersonSimulator::Remote
Remote parameters of this skill implementation.
Definition:
PersonSimulator.h:47
CreateHumanPose.h
VisionX::person_simulator::core::PersonSimulator
The core library for interaction with the person memory. Provides functions for creation and updating...
Definition:
PersonSimulator.h:43
armarx::skills::SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition:
Skill.h:39
armarx::skills::SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams >::main
Skill::MainResult main() final
Definition:
SimpleSpecializedSkill.h:71
armarx::skills::SkillID
Definition:
SkillID.h:14
VisionX::person_simulator::skills::skill_ids::CreateHumanPose
const armarx::skills::SkillID CreateHumanPose
Definition:
skill_ids.h:33
armarx::core::time::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition:
Duration.cpp:48
VisionX
libraries
person_simulator
skills
CreateHumanPose.cpp
Generated on Sat Mar 29 2025 09:17:38 for armarx_documentation by
1.8.17