fix(camera): relax pitch and roll acceptance limits

This commit is contained in:
xsl
2026-10-15 21:16:46 +08:00
parent c6d65493b6
commit 49db1a6f5b
4 changed files with 15 additions and 15 deletions
+7 -7
View File
@@ -35,19 +35,19 @@ for (const yaw of [-18.01, 18.01, -45, 45]) {
assert.equal(check(face(yaw)).hint, '请正对屏幕', 'front correction must not ask for a side view before capture');
assert.equal(check(face(yaw), { mirrored: true }).hint, '请正对屏幕');
}
for (const pitch of [-21.59, 21.59]) assert(check(face(0, pitch)).ok);
for (const pitch of [-21.61, 21.61]) assert.equal(check(face(0, pitch)).hint, '请正对屏幕');
for (const pitch of [-25.99,25.99]) assert(check(face(0, pitch)).ok);
for (const pitch of [-26.01,26.01]) assert.equal(check(face(0, pitch)).hint, '请正对屏幕');
assert.equal(check(face(0), { target: 'right' }).hint, '请向左转头', 'side step retains its proper turn instruction');
assert.equal(check(face(0), { target: 'left' }).hint, '请向右转头');
assert(check(face(0, 0, 12)).ok, 'normal tilt now passes');
assert(check(face(0,0,17.99)).ok);
assert.equal(check(face(0, 0, 18.01)).hint, '请勿歪头');
for(const roll of [-21.99,21.99]) assert(check(face(0,0,roll)).ok);
for(const roll of [-22.01,22.01]) assert.equal(check(face(0,0,roll)).hint,'请勿歪头');
for (const target of ['left','right']) {
const sign=target==='left'?-1:1;
for (const yaw of [23.99,84.01]) assert(!check(face(sign*yaw),{target}).ok);
for (const yaw of [24.01,83.99]) assert(check(face(sign*yaw),{target}).ok);
for (const pitch of [-23.99,23.99]) assert(check(face(sign*45,pitch),{target}).ok);
for (const pitch of [-24.01,24.01]) assert(!check(face(sign*45,pitch),{target}).ok);
for (const pitch of [-28.99,28.99]) assert(check(face(sign*45,pitch),{target}).ok);
for (const pitch of [-29.01,29.01]) assert(!check(face(sign*45,pitch),{target}).ok);
}
assert(check(face(45), { target: 'right' }).ok);
assert(!check(face(45), { target: 'left' }).ok);
@@ -116,7 +116,7 @@ assert.equal(Diagnostics.assess(raw).views.right.status, 'valid');
const normalized = Diagnostics.normalize({ version: Quality.config.version, secret: 'discard', views: { front: { mode: 'live', yaw: 1, score: .9, luma: Infinity, secret: 'discard' }, left: { mode: 'unchecked', reason: 'model-unavailable' } } });
assert.equal(normalized.policy.capture.holdMs, 450);
assert.equal(normalized.policy.capture.minFrames, 2);
assert.equal(normalized.version, '2026-10-15-light-110-220-v6');
assert.equal(normalized.version, '2026-10-15-pitch-roll-relaxed-v7');
assert.equal(normalized.views.front.luma, undefined);
assert(!JSON.stringify(normalized).includes('discard'));
assert.equal(Diagnostics.normalize({ version: '<script>' }).version, 'unknown');