Skip to content
Snippets Groups Projects
Commit b13c762b authored by Fabian Reister's avatar Fabian Reister
Browse files

human pose reader: fix if provider name is unsed

parent baf1f38d
No related branches found
No related tags found
No related merge requests found
#include "HumanPoseReader.h"
#include <iterator>
#include <RobotAPI/libraries/armem/util/util.h>
#include <VisionX/libraries/armem_human/aron/BODY_25Pose.aron.generated.h>
......@@ -21,7 +23,7 @@ namespace armarx::armem::human::client
armarx::armem::client::query::ProviderSegmentSelector& providerQuery =
[&]() -> armem::client::query::ProviderSegmentSelector&
{
if (query.providerName.empty())
if (not query.providerName.empty())
{
return coreSegmentQuery.providerSegments().withName(query.providerName);
}
......@@ -98,6 +100,30 @@ namespace armarx::armem::human::client
const auto coreSegment = qResult.memory.getCoreSegment(properties().coreSegmentName);
if (query.providerName.empty())
{
std::vector<HumanPose> allHumanPoses;
coreSegment.forEachProviderSegment(
[&allHumanPoses](const auto& providerSegment)
{
const std::vector<HumanPose> humanPoses = asHumanPoses(providerSegment);
std::copy(
humanPoses.begin(), humanPoses.end(), std::back_inserter(allHumanPoses));
});
if (allHumanPoses.empty())
{
ARMARX_WARNING << "No entities.";
return {.humanPoses = {},
.status = Result::Status::NoData,
.errorMessage = "No entities"};
}
return Result{.humanPoses = allHumanPoses, .status = Result::Status::Success};
}
// -> provider segment name is set
if (not coreSegment.hasProviderSegment(query.providerName))
{
ARMARX_WARNING << "Provider segment `" << query.providerName
......
......@@ -64,9 +64,10 @@ namespace armarx::armem::human::client
Result query(const Query& query) const;
protected:
::armarx::armem::client::query::Builder buildQuery(const Query& query) const;
protected:
std::string propertyPrefix() const override;
Properties defaultProperties() const override;
};
......
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