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
28
30{
31
32 ::armarx::skills::SkillDescription
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
42 const armarx::skills::SkillID skillId =
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
59
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
The core library for interaction with the person memory.
::armarx::skills::SimpleSpecializedSkill< ::VisionX::person_simulator::skills::arondto::CreateHumanPoseParams > Base
::armarx::skills::SkillDescription GetSkillDescription()
CreateHumanPose(const core::PersonSimulator::Remote &r, const core::PersonSimulator::Properties &p)
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
Definition Duration.cpp:48
virtual MainResult main()
Override this method with the actual implementation.
Definition Skill.cpp:542
const armarx::skills::SkillID CreateHumanPose
Definition skill_ids.h:33
Fixed properties of this skill implementation.
Remote parameters of this skill implementation.
A result struct for th main method of a skill.
Definition Skill.h:62