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

Implement new cluster center function as ellipsoids are 3d objects

parent c7bed5cb
No related branches found
No related tags found
2 merge requests!68Add human tracking,!28Draft: Dev -> Main
......@@ -339,6 +339,18 @@ namespace armarx::navigation::human
return std::max(cluster.ellipsoid.radii.x(), cluster.ellipsoid.radii.y());
}
Eigen::Vector2f
HumanTracker::getClusterCenter(Cluster cluster)
{
Eigen::Vector2f center;
for (auto& point : cluster.points)
{
center += point;
}
center /= cluster.points.size();
return center;
}
void
HumanTracker::prepareTrackedHumans(DateTime time)
{
......
......@@ -200,6 +200,13 @@ namespace armarx::navigation::human
* @return the size
*/
float getClusterSize(Cluster cluster);
/**
* @brief HumanTracker::getClusterCenter Returns the center of the given cluster. That is
* calculated as the mean of all points.
* @param cluster The cluster whose center is calculated
* @return the center
*/
Eigen::Vector2f HumanTracker::getClusterCenter(Cluster cluster);
/**
* @brief prepareTrackedHumans Deletes all tracked humans that received no update for too
* long. All remaining tracked humans are prepared for association with the given point in
......
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