Skip to content
Snippets Groups Projects
Commit f08c04db authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Merge branch 'fix/compile-and-check-for-keypoint' into 'master'

Add check if keypoint is available

See merge request !11
parents 27f7fea4 d3ddc968
No related branches found
No related tags found
1 merge request!11Add check if keypoint is available
......@@ -158,7 +158,7 @@ namespace armarx::view_selection::components::person_target_provider
{
armarx::armem::human::client::Reader::Query query{
.providerName = "OpenNIPointCloudProvider",
.timestamp = armarx::Clock::Now()
.timestamp = armarx::Clock::Now(),
};
armarx::core::time::StopWatch sw;
auto result = humanPoseReaderPlugin->get().query(query);
......@@ -168,12 +168,21 @@ namespace armarx::view_selection::components::person_target_provider
std::vector<GazeTargetWithFeatures> gazeTargets(result.humanPoses.size());
for (size_t i = 0; i < result.humanPoses.size(); i++)
{
auto human = result.humanPoses[i];
const armem::human::HumanPose& human = result.humanPoses[i];
GazeTargetWithFeatures& target = gazeTargets[i];
// TODO check whether "Head" keypoint is available
gazeTargets[i].position = human.keypoint3dMap["Head"].positionGlobal;
// gazeTargets[i].trackingName = human.humanTrackingId.value_or("default_human");
gazeTargets[i].ishuman = true;
// Check whether "Head" keypoint is available
if (auto it = human.keypoint3dMap.find("Head"); it != human.keypoint3dMap.end())
{
const armem::human::Keypoint3D& kp = it->second;
target.position = kp.positionGlobal;
target.trackingName = "default_human"; // human.humanTrackingId.value_or("default_human");
target.ishuman = true;
}
else
{
// TODO: What if it is not?
}
}
return gazeTargets;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment