fix(calibration): gesture wording matches derivation (todo 9); restore build.sh exec bit
This commit is contained in:
1 parent
ee6781ef31
commit
48eb19dd43
5 files changed
+53
-7
No files matched your search
@@ -110,6 +110,50 @@ TEST(calibration, DeriveArmGainsAveragesHoldAndScalesToTargetReach) {
|
||||
EXPECT_NEAR(gains.y, nui::calibration::kTargetArmReachY / 0.3f, 1e-5f);
|
||||
}
|
||||
|
||||
// Plan todo 9 (Final Verification F2): the calibration prompt tells the
|
||||
// player to raise the arm UP and OUT toward a top screen corner - diagonal,
|
||||
// giving both lateral (X) and above-shoulder (Y) reach - not a purely
|
||||
// horizontal "out to the side" hold. A diagonal observation like this must
|
||||
// derive succeed with both gains inside the open (1.0, 6.0) range (neither
|
||||
// rejected for a too-small reach nor pinned to the kArmGainMax clamp), while
|
||||
// the horizontal-only gesture the old wording asked for (no vertical reach)
|
||||
// must still be rejected so a regression back to that wording is caught.
|
||||
TEST(calibration, DeriveArmGainsSucceedsOnDiagonalUpAndOutGesture) {
|
||||
std::vector<nui::calibration::RaiseRightArmObservation> diagonal_hold;
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
nui::calibration::RaiseRightArmObservation o{};
|
||||
o.person_detected = true;
|
||||
o.measured_reach_x = 0.5f; // lateral reach
|
||||
o.measured_reach_y = 0.3f; // reach above the shoulder
|
||||
diagonal_hold.push_back(o);
|
||||
}
|
||||
nui::calibration::ArmGains gains{};
|
||||
std::string error;
|
||||
ASSERT_TRUE(
|
||||
nui::calibration::derive_arm_gains(diagonal_hold, gains, error));
|
||||
EXPECT_TRUE(error.empty());
|
||||
EXPECT_GT(gains.x, nui::calibration::kArmGainMin);
|
||||
EXPECT_LT(gains.x, nui::calibration::kArmGainMax);
|
||||
EXPECT_GT(gains.y, nui::calibration::kArmGainMin);
|
||||
EXPECT_LT(gains.y, nui::calibration::kArmGainMax);
|
||||
|
||||
// The horizontal-only gesture the old wording produced (no vertical reach)
|
||||
// must still fail with the "reach too small" error, not silently succeed.
|
||||
std::vector<nui::calibration::RaiseRightArmObservation> horizontal_hold;
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
nui::calibration::RaiseRightArmObservation o{};
|
||||
o.person_detected = true;
|
||||
o.measured_reach_x = 0.5f;
|
||||
o.measured_reach_y = 0.0f;
|
||||
horizontal_hold.push_back(o);
|
||||
}
|
||||
nui::calibration::ArmGains unused_gains{};
|
||||
std::string horizontal_error;
|
||||
EXPECT_FALSE(nui::calibration::derive_arm_gains(horizontal_hold, unused_gains,
|
||||
horizontal_error));
|
||||
EXPECT_NE(horizontal_error.find("too small"), std::string::npos);
|
||||
}
|
||||
|
||||
TEST(calibration, DeriveArmGainsClampsToRangeAndRejectsBadHolds) {
|
||||
nui::calibration::ArmGains gains{};
|
||||
std::string error;
|
||||
|
||||
Reference in new issue
Block a user