feat: add bilateral left/right arm tracking for bicep curls#526
Open
Shikhar-404exe wants to merge 16 commits into
Open
feat: add bilateral left/right arm tracking for bicep curls#526Shikhar-404exe wants to merge 16 commits into
Shikhar-404exe wants to merge 16 commits into
Conversation
- Compute elbowLeft/elbowRight and shoulderLeft/shoulderRight angles in angleUtils, poseWorker, and GPU shader (WGSL) - Add bilateral config flag to ExerciseConfig and bicepCurl definition - Track independent stage machines per arm in ExerciseEngine with separate history, downAngleReached, cooldown, and rep counting - Auto-initialize per-arm stages from current angle when undefined - Update feedbackEngine bicepCurl rules to check both arms - Add 3 tests: left-arm-only rep, bilateral simultaneous reps, fresh initialization from scratch - Fix duplicate return properties in exerciseEngine (pre-existing)
|
@Shikhar-404exe is attempting to deploy a commit to the somiljain2024-4175's projects Team on Vercel. A member of the Team first needs to authorize it. |
- Replay3DModel.tsx: restore from c746efc to fix parse error caused by unmerged stress vector shader (PR Somil450#455) that re-broke types and shaders - WorkoutScreen.tsx: move useWorkoutWebSocket() from callback to component body (react-hooks/rules-of-hooks), add missing CameraErrorBoundary import Reduces CI lint errors from 3 to 0 (64 warnings remain, all pre-existing).
Owner
|
@Shikhar-404exe Thank you for the contribution. This introduces a significant change to the rep-counting logic by moving from single-arm tracking to independent left/right arm tracking. Before I proceed further, could you please provide a short demo video showing:
Also, please resolve the current merge conflicts with the latest |
…art workout in running state
…tion, and layout - Add per-arm last-rep-time cooldowns so each arm counts independently - Fix totalReps increment (2 when both arms rep same frame) - Add per-arm rep display in real-time floating panel and summary - Remove combined rep count for bilateral exercises - Disable STOP gesture for bilateral (curling arms looks like crossed arms) - Fix duration showing 00:00 by computing from ref instead of state - Camera: reuse stream across screens, fix play race condition - Layout: z-index fixes, flex wrapper, soft camera stop
Resolved conflicts in: - Replay3DModel.tsx (accepted upstream version) - WelcomeScreen.tsx (merged data-theme + structure) - WorkoutScreen.tsx (merged imports, states, error handling) - exerciseEngine.ts (merged bilateral tracking + plank spline)
…nderer, test, workoutSyncService
…orkoutScreen, exerciseEngine, workoutSyncService
Contributor
Author
…aErrorBoundary, useTheme, useWorkoutWebSocket, GhostStats, jointDeviationProfiler, calculateAngle import
Contributor
Author
|
any update on when this'll be merged ? i have linked the demo video of running this feature locally in my earlier comment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary #43
Adds independent left and right arm tracking for bicep curls. Previously the engine picked the "best visible side" and tracked only that arm. Now both arms are tracked independently — each arm counts reps when it completes a full curl cycle, and total reps = left + right.
Changes
Angle Computation (3 files)
angleUtils.ts— ComputeelbowLeft,elbowRight,shoulderLeft,shoulderRightfrom MediaPipe landmarksposeWorker.ts— Same bilateral angles in the web workergpuAngleUtils.ts— Expand WGSL shader from 9→11 floats, add GPU-sideelbowLeft/elbowRightConfig
exercises.ts— Addbilateral?: booleanandbilateralJoints?: { left, right }toExerciseConfig. Setbilateral: trueonbicepCurl.Engine
exerciseEngine.ts— Core change:EngineStategains 10 new optional fields:leftHistory,rightHistory,leftStage,rightStage,leftDownAngleReached,rightDownAngleReached,leftStageStartTime,rightStageStartTime,leftRepCount,rightRepCountprocess()detectsconfig.bilateraland runs two independent state machines (one per arm)up→down→upwith its own smoothed angle, history buffer, cooldown, and down-duration trackingreps = leftRepCount + rightRepCountFeedback
feedbackEngine.ts— BicepCurl rules checkleftStage/rightStageandshoulderLeft/shoulderRightinstead of single-side onlyTests (3 new)
leftRepCountincrementsreps = 2leftStage/rightStageinitialize from angle whenundefinedVerification
Files Changed