CreateHumanProfile.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 "
CreateHumanProfile.h
"
24
25
#include "
VisionX/libraries/armem_human/aron_conversions.h
"
26
#include "
VisionX/libraries/person_simulator/core/PersonSimulator.h
"
27
#include "
VisionX/libraries/person_simulator/skills/constants.h
"
28
#include "
VisionX/libraries/person_simulator/skills/skill_ids.h
"
29
30
namespace
VisionX::person_simulator::skills
31
{
32
33
::armarx::skills::SkillDescription
34
CreateHumanProfile::GetSkillDescription
()
35
{
36
ParamType
defaultParams;
37
armarx::human::arondto::PersonID
id
= armarx::human::arondto::PersonID();
38
id
.firstName =
"John"
;
39
id
.lastName =
"Handover"
;
40
defaultParams.profileID = id;
41
42
const
std::string skillName =
43
VisionX::person_simulator::skills::constants::CreateHumanProfile
;
44
const
armarx::skills::SkillID
skillId =
45
VisionX::person_simulator::skills::skill_ids::CreateHumanProfile
;
46
47
return ::armarx::skills::SkillDescription{
48
.skillId = skillId,
49
.description =
"Creates and commits an empty profile with the defined name."
,
50
.rootProfileDefaults = defaultParams.toAron(),
51
.timeout =
::armarx::Duration::MilliSeconds
(1000),
52
.parametersType = ParamType::ToAronType()};
53
}
54
55
CreateHumanProfile::CreateHumanProfile
(
const
core::PersonSimulator::Remote
& r,
56
const
core::PersonSimulator::Properties
& p) :
57
Base
(
GetSkillDescription
()), remote(r), properties(p)
58
{
59
}
60
61
CreateHumanProfile::MainResult
62
CreateHumanProfile::main
(
const
SpecializedMainInput& in)
63
{
64
core::PersonSimulator
simulator(remote, properties);
65
armarx::armem::human::PersonID
id
=
armarx::armem::human::PersonID
();
66
fromAron(in.parameters.profileID,
id
);
67
simulator.createHumanProfile(
id
);
68
return
Skill::MakeSucceededResult();
69
}
70
71
}
// namespace VisionX::person_simulator::skills
CreateHumanProfile.h
PersonSimulator.h
aron_conversions.h
constants.h
skill_ids.h
VisionX::person_simulator::core::PersonSimulator
The core library for interaction with the person memory.
Definition
PersonSimulator.h:44
VisionX::person_simulator::skills::CreateHumanProfile::CreateHumanProfile
CreateHumanProfile(const core::PersonSimulator::Remote &r, const core::PersonSimulator::Properties &p)
Definition
CreateHumanProfile.cpp:55
VisionX::person_simulator::skills::CreateHumanProfile::GetSkillDescription
::armarx::skills::SkillDescription GetSkillDescription()
Definition
CreateHumanProfile.cpp:34
VisionX::person_simulator::skills::CreateHumanProfile::Base
::armarx::skills::SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams > Base
Definition
CreateHumanProfile.h:42
armarx::Duration::MilliSeconds
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition
Duration.cpp:48
armarx::skills::SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams >::ParamType
::VisionX::person_simulator::skills::arondto::CreateHumanProfileParams ParamType
Definition
SimpleSpecializedSkill.h:22
armarx::skills::SkillID
Definition
SkillID.h:15
armarx::skills::Skill::main
virtual MainResult main()
Override this method with the actual implementation.
Definition
Skill.cpp:542
VisionX::person_simulator::skills::constants::CreateHumanProfile
const std::string CreateHumanProfile
Definition
constants.h:31
VisionX::person_simulator::skills::skill_ids::CreateHumanProfile
const armarx::skills::SkillID CreateHumanProfile
Definition
skill_ids.h:32
VisionX::person_simulator::skills
Definition
constants.h:29
VisionX::person_simulator::core::PersonSimulator::Properties
Fixed properties of this skill implementation.
Definition
PersonSimulator.h:57
VisionX::person_simulator::core::PersonSimulator::Remote
Remote parameters of this skill implementation.
Definition
PersonSimulator.h:48
armarx::armem::human::PersonID
Definition
types.h:139
armarx::skills::Skill::MainResult
A result struct for th main method of a skill.
Definition
Skill.h:62
VisionX
libraries
person_simulator
skills
CreateHumanProfile.cpp
Generated by
1.13.2