Skip to content

Commit ff861a4

Browse files
committed
fix: gate toe-height warning on shin orientation like heel/sole
A foot on its ball (plank, knee-drive) with the shin laid down legitimately lifts its toe off the flat plane; only flag toe-height when a flat foot is expected (shin near-vertical), matching the existing heel/sole gate. Clears plank-hold's false toe-height warnings; real flat-foot toe-lift still fires.
1 parent ac0fcd7 commit ff861a4

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

packages/posecode-eval/src/diagnostics.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,21 @@ export function createClipDiagnosticsCollector(sampleRateHz: number): ClipDiagno
214214
}
215215
state.supportedSamples++;
216216
const location = { timeSec: frame.timeSec, phaseName: frame.phaseName };
217-
state.minToeHeightMeters = Math.min(state.minToeHeightMeters ?? Infinity, foot.toeHeight);
218-
state.maxToeHeightMeters = Math.max(state.maxToeHeightMeters ?? -Infinity, foot.toeHeight);
219-
if (Math.abs(foot.toeHeight) > state.worstToeAbs) {
220-
state.worstToeAbs = Math.abs(foot.toeHeight);
221-
state.worstToe = location;
222-
}
223-
// Flat-sole grounding checks only apply when a flat foot is expected: the
224-
// ankle is not plantarflexed AND the shin stands near-vertical. A foot on
225-
// its ball with the shin laid down (plank, knee-drive) legitimately shows
226-
// a steep sole and lifted heel, so measuring it as a failed flat plant
227-
// fabricates warnings.
217+
// Flat-foot grounding checks (heel/toe height, sole tilt) only apply when a
218+
// flat foot is expected: the ankle is not plantarflexed AND the shin stands
219+
// near-vertical. A foot on its ball with the shin laid down (plank,
220+
// knee-drive) legitimately shows a lifted heel/toe and a steep sole, so
221+
// measuring it as a failed flat plant fabricates warnings.
228222
const shinDeg = shinFromVerticalDeg(m, side);
229223
const expectedFlat =
230224
foot.plantigrade && (shinDeg === null || shinDeg <= FLAT_SOLE_SHIN_MAX_DEG);
231225
if (expectedFlat) {
226+
state.minToeHeightMeters = Math.min(state.minToeHeightMeters ?? Infinity, foot.toeHeight);
227+
state.maxToeHeightMeters = Math.max(state.maxToeHeightMeters ?? -Infinity, foot.toeHeight);
228+
if (Math.abs(foot.toeHeight) > state.worstToeAbs) {
229+
state.worstToeAbs = Math.abs(foot.toeHeight);
230+
state.worstToe = location;
231+
}
232232
state.plantigradeSamples++;
233233
state.minHeelHeightMeters = Math.min(state.minHeelHeightMeters ?? Infinity, foot.heelHeight);
234234
state.maxHeelHeightMeters = Math.max(state.maxHeelHeightMeters ?? -Infinity, foot.heelHeight);

0 commit comments

Comments
 (0)