fix(mapping): swap L/R joint assignments so the mirrored camera puts the player's right hand in HAND_RIGHT (was landing in HAND_LEFT); matches real Kinect convention. Update golden + occlusion tests.

This commit is contained in:
kinect-bot committed 2026-11-26 23:39:49 -05:00
1 parent 91c4e82ea6
commit cb5e8f7865
2 files changed
+40 -25

No files matched your search

+16 -9
View File
@@ -65,27 +65,32 @@ TEST(mapping, ForwardInverseRoundTripStaysBelowOneMillimeter) {
}
TEST(mapping, LandmarkFixtureMapsAllTwentyJointsToGoldenPositions) {
// L/R joints are swapped vs MediaPipe labels (see make_joint_landmarks): the
// tracker mirrors the camera, so the player's right side comes from
// MediaPipe's left-side landmarks. NUI LEFT joints (4-7,12-15) therefore take
// the MediaPipe right-side fixture values and NUI RIGHT joints (8-11,16-19)
// take the left-side values.
const std::array<Vector4, nui::contract::kJointCount> expected{{
{0.14879250f, -0.14879250f, 2.5f, 1.0f},
{-0.07877250f, 0.07877250f, 2.5f, 1.0f},
{-0.35885250f, 0.35885250f, 2.5f, 1.0f},
{-0.57766500f, 0.57766500f, 2.5f, 1.0f},
{-0.37635750f, 0.37635750f, 2.5f, 1.0f},
{-0.29320875f, 0.29320875f, 2.5f, 1.0f},
{-0.21006000f, 0.21006000f, 2.5f, 1.0f},
{-0.08314875f, 0.08314875f, 2.5f, 1.0f},
{-0.33697125f, 0.33697125f, 2.5f, 1.0f},
{-0.25382250f, 0.25382250f, 2.5f, 1.0f},
{-0.16629750f, 0.16629750f, 2.5f, 1.0f},
{-0.04376250f, 0.04376250f, 2.5f, 1.0f},
{0.12691125f, -0.12691125f, 2.5f, 1.0f},
{0.21006000f, -0.21006000f, 2.5f, 1.0f},
{0.29320875f, -0.29320875f, 2.5f, 1.0f},
{0.46388250f, -0.46388250f, 2.5f, 1.0f},
{-0.37635750f, 0.37635750f, 2.5f, 1.0f},
{-0.29320875f, 0.29320875f, 2.5f, 1.0f},
{-0.21006000f, 0.21006000f, 2.5f, 1.0f},
{-0.08314875f, 0.08314875f, 2.5f, 1.0f},
{0.16629750f, -0.16629750f, 2.5f, 1.0f},
{0.25382250f, -0.25382250f, 2.5f, 1.0f},
{0.33697125f, -0.33697125f, 2.5f, 1.0f},
{0.50326875f, -0.50326875f, 2.5f, 1.0f},
{0.12691125f, -0.12691125f, 2.5f, 1.0f},
{0.21006000f, -0.21006000f, 2.5f, 1.0f},
{0.29320875f, -0.29320875f, 2.5f, 1.0f},
{0.46388250f, -0.46388250f, 2.5f, 1.0f},
}};
nui::mapping::MappingConfig config{};
config.mirror = false;
@@ -183,7 +188,9 @@ TEST(mapping, OccludedJointIsInferredAndHoldsLastSmoothedPosition) {
nui::mapping::SkeletonMapper mapper(config);
const auto visible_frame = mapper.map(landmarks);
const auto last_wrist = visible_frame.joints[6].position;
landmarks[15] = {0.0f, 0.0f, 0.0f, -100.0f};
// After the L/R swap, NUI WRIST_LEFT (joint 6) is fed by MediaPipe's
// RIGHT_WRIST (landmark 16), so occlude 16 to occlude joint 6.
landmarks[16] = {0.0f, 0.0f, 0.0f, -100.0f};
const auto occluded_frame = mapper.map(landmarks);