HumanPoseWriter.cpp
Go to the documentation of this file.
1#include "HumanPoseWriter.h"
2
4
6
8
10{
11
12
16
17 Writer::~Writer() = default;
18
19 void
24
25 void
27 {
28 ARMARX_VERBOSE << "Connecting ...";
30 ARMARX_VERBOSE << "Connected.";
31
32 humanMemory =
33 armem::human::HumanMemoryServerInterfacePrx::checkedCast(this->memoryWriter().memory);
34 }
35
36 bool
38 const std::string& provider,
39 const armem::Time& referencedTime)
40 {
41 ARMARX_WARNING << "NYI";
42 return true;
43 }
44
45 bool
46 Writer::commitHumanPoses(const std::vector<HumanPose>& humanPoses,
47 const std::string& provider,
48 const armem::Time& referencedTime)
49 {
50 ARMARX_WARNING << "NYI";
51 return true;
52 }
53
54 bool
56 const std::string& provider,
57 const armem::Time& referencedTime)
58 {
59 return commitHumanPosesInCameraFrame({humanPose}, provider, referencedTime);
60 }
61
62 bool
63 Writer::commitHumanPosesInCameraFrame(const std::vector<HumanPose>& humanPoses,
64 const std::string& provider,
65 const armem::Time& referencedTime)
66 {
69
70 std::vector<armarx::aron::data::dto::DictPtr> humanPosesDto;
71 for (const HumanPose& humanPose : humanPoses)
72 {
73 armarx::human::arondto::HumanPose humanPoseAron;
74 toAron(humanPoseAron, humanPose);
75 humanPosesDto.push_back(humanPoseAron.toAronDTO());
76 }
77
78 core::time::dto::DateTime referencedTimeDto;
79 toIce(referencedTimeDto, referencedTime);
80
81 try
82 {
83 humanMemory->commitHumanPosesInCameraFrame(humanPosesDto, provider, referencedTimeDto);
84 return true;
85 }
86 catch (...)
87 {
88 ARMARX_INFO << "Failed to commit human poses: " << GetHandledExceptionString();
89 return false;
90 }
91 }
92
93} // namespace armarx::armem::human::client
The memory name system (MNS) client.
void connect(armarx::armem::client::MemoryNameSystem &mns)
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
bool commitHumanPose(const HumanPose &humanPose, const std::string &provider, const armem::Time &referencedTime)
void connect(armem::client::MemoryNameSystem &memoryNameSystem)
bool commitHumanPosesInCameraFrame(const std::vector< HumanPose > &humanPoses, const std::string &provider, const armem::Time &referencedTime)
Calls a dedicated interface of the human memory in order to resolve keypoints in several frames given...
bool commitHumanPoseInCameraFrame(const HumanPose &humanPose, const std::string &provider, const armem::Time &referencedTime)
bool commitHumanPoses(const std::vector< HumanPose > &humanPoses, const std::string &provider, const armem::Time &referencedTime)
void registerPropertyDefinitions(armarx::PropertyDefinitionsPtr &def)
Brief description of class memory.
Definition memory.h:39
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
#define ARMARX_VERBOSE
The logging level for verbose information.
Definition Logging.h:187
void toAron(armarx::human::arondto::HumanPose &dto, const HumanPose &bo)
armarx::core::time::DateTime Time
void toIce(data::MemoryID &ice, const MemoryID &id)
void toAron(T &dto, const T &bo)
Framework for converting ARON DTOs (Data Transfer Objects) to C++ BOs (Business Objects) and back.
std::string GetHandledExceptionString()
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.