PersonSimulator.h
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::core
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#pragma once
24
25#include <Eigen/Geometry>
26
27#include <VirtualRobot/VirtualRobot.h>
28
34
36
38{
39 /**
40 * @class PersonSimulator
41 * @brief The core library for interaction with the person memory. Provides functions for creation and updating of entries.
42 */
44 {
45 public:
46 /// Remote parameters of this skill implementation
47 struct Remote
48 {
49 // for interaction with memory
51 // for robot position
53 };
54
55 /// Fixed properties of this skill implementation
57 {
58 // the name of the robot, for camera frames
59 std::string robotName;
60 // the poseModelId to use for new poses
61 std::string poseModelId;
63 std::string poseProviderName;
65 };
66
75
76 /// Constructor of this skill implementation
77 PersonSimulator(const Remote& r, const Properties& p);
78
79 // API
80 // note: robot name is specified in properties
82 void createFaceRecognition(const Eigen::Vector3f& facePosition,
83 std::optional<std::string> entityName);
84
85 /// return values are copies of the committed poses, needed for creating a pose+facerecognition
86 armarx::armem::human::HumanPose createHumanPose(const std::string& humanId,
87 Eigen::Vector2f meanFloorPosition,
88 float clockwiseOrientationDegrees);
90 createHumanPoseFacingRobot(const std::string& humanId, Eigen::Vector2f meanFloorPosition);
91
92 std::optional<armarx::armem::MemoryID> findProfileId(std::string& entityId);
93
94 private:
95 Remote remote;
96 Properties properties;
97 GeneratedPoseParams generatedPoseParams;
98
99 unsigned int faceRecognitionIdCounter = 0;
100
101 static std::string increaseAndConvert(unsigned int& counter);
102
103 /// Constructs the "default" pose with partially incomplete keypoints (see "constructKeyPoint")
104 std::map<std::string, armarx::armem::human::PoseKeypoint>
105 constructDefaultKeypoints(Eigen::Vector2f meanFloorPosGlobal,
106 float clockwiseOrientationDegrees);
107
108 /// Constructs a keypoint at a given position. Only the global position is set; everything else is an identity.
109 armarx::armem::human::PoseKeypoint constructKeyPoint(Eigen::Vector3f globalPos,
110 const std::string& label);
111 };
112
113} // namespace VisionX::person_simulator::core
armarx::armem::human::HumanPose createHumanPose(const std::string &humanId, Eigen::Vector2f meanFloorPosition, float clockwiseOrientationDegrees)
return values are copies of the committed poses, needed for creating a pose+facerecognition
std::optional< armarx::armem::MemoryID > findProfileId(std::string &entityId)
PersonSimulator(const Remote &r, const Properties &p)
Constructor of this skill implementation.
void createHumanProfile(const armarx::armem::human::PersonID &humanID)
void createFaceRecognition(const Eigen::Vector3f &facePosition, std::optional< std::string > entityName)
armarx::armem::human::HumanPose createHumanPoseFacingRobot(const std::string &humanId, Eigen::Vector2f meanFloorPosition)
The memory name system (MNS) client.
Fixed properties of this skill implementation.
Remote parameters of this skill implementation.
armarx::armem::client::MemoryNameSystem & mns
armarx::armem::robot_state::VirtualRobotReader & robotReader