Go to the documentation of this file.
27 #include <Eigen/src/Geometry/AngleAxis.h>
28 #include <Eigen/src/Geometry/Quaternion.h>
29 #include <SimoxUtility/algorithm/get_map_keys_values.h>
30 #include <SimoxUtility/algorithm/string/string_tools.h>
44 #include <VisionX/libraries/armem_human/aron/FaceRecognition.aron.generated.h>
45 #include <VisionX/libraries/armem_human/aron/HumanPose.aron.generated.h>
46 #include <VisionX/libraries/armem_human/aron/Profile.aron.generated.h>
97 PersonMemoryDebugger::run()
99 ARMARX_INFO <<
"Use 'pose [id] [x] [y] [z]' to commit a pose at location";
100 ARMARX_INFO <<
"Use 'face [profile entityName] [x] [y] [z]' to commit a face at location";
101 ARMARX_INFO <<
"Use 'profile [profile entityName]' to commit a profile";
105 if (command ==
"pose")
109 else if (command ==
"face")
111 faceRecognitionCommand();
113 else if (command ==
"profile")
117 else if (command ==
"exit")
130 PersonMemoryDebugger::poseCommand()
132 std::string id, x_s, y_s, z_s;
133 std::cin >>
id >> x_s >> y_s >> z_s;
134 float x = std::stof(x_s);
135 float y = std::stof(y_s);
136 float z = std::stof(z_s);
137 Eigen::Vector3f pos(x, y, z);
142 PersonMemoryDebugger::faceRecognitionCommand()
144 std::string id, x_s, y_s, z_s;
145 std::cin >>
id >> x_s >> y_s >> z_s;
147 auto profileId = findProfileId(
id);
148 if (not profileId.has_value())
153 float x = std::stof(x_s);
154 float y = std::stof(y_s);
155 float z = std::stof(z_s);
157 Eigen::Vector3f pos(x, y, z);
158 commitFaceRecognition(pos, profileId);
162 PersonMemoryDebugger::profileCommand()
170 PersonMemoryDebugger::commitProfile(std::string& name)
180 dto.firstName = name;
187 .entityID = entityId,
188 .instancesData = {dto.toAron()},
195 ARMARX_INFO <<
"Committing profile with name: " << name;
199 std::optional<armarx::armem::MemoryID>
200 PersonMemoryDebugger::findProfileId(std::string& entityId)
207 std::optional<armarx::armem::MemoryID> foundProfileId = std::nullopt;
219 if (foundProfileId.has_value())
228 foundProfileId = instance.id();
233 return foundProfileId;
237 PersonMemoryDebugger::commitFaceRecognition(Eigen::Vector3f& facePosition, std::optional<armarx::armem::MemoryID> profileId)
243 std::stringstream ss;
250 bo.position3DGlobal = facePosition;
252 bo.profileID = std::move(profileId);
254 armarx::human::arondto::FaceRecognition dto;
262 .entityID = entityId,
263 .instancesData = {dto.toAron()},
277 PersonMemoryDebugger::commitPose(Eigen::Vector3f& facePosition, std::string& humanId)
303 .orientationGlobal = defaultOrientation,
313 armarx::human::arondto::HumanPose dto;
317 .entityID = entityId,
318 .instancesData = {dto.toAron()},
325 ARMARX_INFO <<
"Committing pose with HumanID '" << humanId <<
"'.";
333 return "PersonMemoryDebugger";
void onInitComponent() override
Reads data from a memory server.
wm::Memory memory
The slice of the memory that matched the query.
QueryResult getLatestSnapshotsIn(const MemoryID &id, armem::query::DataMode dataMode=armem::query::DataMode::WithData) const
Get the latest snapshots under the given memory ID.
const armem::MemoryID FaceRecognitionCoreSegmentID
Client-side working entity instance.
void toAron(armarx::human::arondto::HumanPose &dto, const HumanPose &bo)
MemoryNameSystem & memoryNameSystem()
This file is part of ArmarX.
void onConnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Writer getWriter(const MemoryID &memoryID)
Get a writer to the given memory name.
std::string getDefaultName() const override
void Identity(MatrixXX< N, N, T > *a)
MemoryID withProviderSegmentName(const std::string &name) const
const simox::meta::EnumNames< Joints > JointNames
Names of the joints as defined in the body model.
static const std::string recognition_provider_name
std::string cameraFrameName
armarx::human::arondto::Profile Profile
An update of an entity for a specific point in time.
Helps a memory client sending data to a memory.
CommitResult commit(const Commit &commit) const
Writes a Commit to the memory.
The FramedOrientation class.
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
std::optional< std::string > humanTrackingId
const std::string ModelId
void onExitComponent() override
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
MemoryID withEntityName(const std::string &name) const
static const std::string pose_provider_name
const VariantTypeId FramedOrientation
Default component property definition container.
const armem::MemoryID ProfileCoreSegmentID
bool forEachInstance(InstanceFunctionT &&func)
void onDisconnectComponent() override
const armem::MemoryID PoseCoreSegmentID
const VariantTypeId FramedPosition
Reader getReader(const MemoryID &memoryID)
Get a reader to the given memory name.
static const std::string profile_provider_name
const std::optional< BoT > & bo