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

Implement HumanTracker::mostRecentTrackedHumans()

parent 38637b2d
No related branches found
No related tags found
2 merge requests!38human tracker skeleton,!28Draft: Dev -> Main
......@@ -49,6 +49,32 @@ namespace armarx::navigation::components::dynamic_scene_provider
{
}
std::vector<human::Human>
HumanTracker::mostRecentTrackedHumans() const
{
if (trackedHumans.empty())
{
return {};
}
std::sort(trackedHumans.begin(),
trackedHumans.end(),
[](human::Human a, human::Human b) -> bool
{ return a.detectionTime.operator<=(b.detectionTime); });
DateTime mostRecentTime = trackedHumans.back().detectionTime;
std::vector<human::Human> mostRecentHumans;
for (human::Human trackedHuman : trackedHumans)
{
if (trackedHuman.detectionTime == mostRecentTime)
{
mostRecentHumans.push_back(trackedHuman);
}
}
return mostRecentHumans;
}
void
HumanTracker::reset()
......
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