Skip to content
Snippets Groups Projects
Commit da681818 authored by Corvin-N's avatar Corvin-N
Browse files

Implement HumanTracker::getMeasurementPositions()

parent 14fe9382
No related branches found
No related tags found
2 merge requests!38human tracker skeleton,!28Draft: Dev -> Main
......@@ -11,18 +11,11 @@ namespace armarx::navigation::components::dynamic_scene_provider
{
trackedHumans.clear();
auto positions = getMeasurementPositions(measurements);
for (const armem::human::HumanPose& humanPose : measurements.humanPoses)
{
const armem::human::Keypoint3DIdMap& keypoints = humanPose.keypoint3dMap;
ARMARX_CHECK_NOT_EMPTY(keypoints);
Eigen::Vector3f centerPos = Eigen::Vector3f::Zero();
for (const auto& [_, v] : keypoints)
{
centerPos += v.positionGlobal;
}
centerPos /= static_cast<float>(keypoints.size());
auto centerPos = positions.find(humanPose);
core::Pose2D pose = core::Pose2D::Identity();
pose.translation() = Eigen::Vector2f{centerPos.x(), centerPos.y()};
......@@ -44,13 +37,38 @@ namespace armarx::navigation::components::dynamic_scene_provider
}
std::map<const armem::human::HumanPose&, armarx::navigation::core::Position>
HumanTracker::getMeasurementPositions(const Measurements& measurements) const
{
std::map<armem::human::HumanPose&, armarx::navigation::core::Position> map;
for (const armem::human::HumanPose& humanPose : measurements.humanPoses)
{
const armem::human::Keypoint3DIdMap& keypoints = humanPose.keypoint3dMap;
ARMARX_CHECK_NOT_EMPTY(keypoints);
auto centerPos = armarx::navigation::core::Position::Zero();
for (const auto& [_, v] : keypoints)
{
centerPos += v.positionGlobal;
}
centerPos /= static_cast<float>(keypoints.size());
map.insert(
std::pair<const armem::human::HumanPose&, armarx::navigation::core::Position>(
humanPose, centerPos));
}
}
std::map<armem::human::HumanPose&, human::Human&>
HumanTracker::getAssociatedHumans(const Measurements& measurements) const
{
}
std::vector<human::Human>
HumanTracker::mostRecentTrackedHumans() const
HumanTracker::getMostRecentTrackedHumans() const
{
if (trackedHumans.empty())
{
......
......@@ -31,7 +31,12 @@ namespace armarx::navigation::components::dynamic_scene_provider
private:
std::vector<human::Human> trackedHumans;
std::map<const armem::human::HumanPose&, armarx::navigation::core::Position>
getMeasurementPositions(const Measurements& measurements) const;
std::map<armem::human::HumanPose&, human::Human&>
getAssociatedHumans(const Measurements& measurements) const;
std::vector<human::Human> getMostRecentTrackedHumans() const;
};
} // namespace armarx::navigation::components::dynamic_scene_provider
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