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

Extract rotation from human pose keypoints

parent f245fd9f
No related branches found
No related tags found
3 merge requests!68Add human tracking,!53Draft: Implement basic version of kalman filter for human tracking,!28Draft: Dev -> Main
......@@ -30,8 +30,18 @@ namespace armarx::navigation::human
core::Pose2D pose = core::Pose2D::Identity();
pose.translation() = conv::to2D(centerPos);
//TODO: angle
pose.linear() = Eigen::Rotation2Df(0).toRotationMatrix();
double yaw = 0;
if (humanPose.keypoints.find("HEAD") != humanPose.keypoints.end())
{
yaw = humanPose //from all human pose keypoints
.keypoints
.find("HEAD") //find the keypoint representing the head
->second
.orientationGlobal //get its global orientation
->toEigen()
.eulerAngles(2, 1, 0)[0]; //and extract the yaw (rotation around z axis)
}
pose.linear() = Eigen::Rotation2Df(yaw).toRotationMatrix();
return {pose, humanPose.humanTrackingId, time, false};
}
......
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