Squat Challenge

Squat Challenge is the ultimate tool for tracking your at-home fitness progress! This lens uses your phone's camera to count the number of squats you complete, making it easy to see how you're improving over time. It also remembers your progress up to a week for longer term tracking. Squats are a full-body exercise that work multiple muscle groups, making them an efficient and effective choice for overall strength and fitness development. Plus it’s so easy that anyone can do it!

Try it here

Feature Rich

  • Camera detects your body movements and count squats
  • Track weekly progress
  • Voice feedback, turn your volume up!
  • Intelligent Calibration: automatically adapts to your height and camera angle
  • Distance Detection: ensures you’re standing in the right position before countdown begins

Inspiration

I was inspired to create Squat Challenge after exploring the capabilities of Lens Studios. I realized that we could track body movements of any part of our body using built in assets!

With the start of a new year, many of us want to lead a healthier life including myself, and I wanted to build a tool that would make it easy and fun for people to see how they were improving over time. I chose squats because it is one of the exercise I was personally doing, and it was easy for anyone to perform anywhere. I hope that Squat Challenge will help people stay motivated and on track as they work towards their fitness goals.

How we built it

A lot of scripting was written to put things together, and I also used some assets from Snap like Text to Speech, Full Body Colliders, Input Modal, UI Systems, and a couple of fancy fonts. For remembering weekly progress, I used the persistence store which resets at the start of each week.

The two main script files are:

  • ActionController.js
    • Handle user input events
  • SquatMovementTracker.js
    • Monitors and track physical movements of squats

Here is a diagram representation of the internal workings of the lens:

Technical Flow

Challenges we ran into

One difficult challenge I faced was that the position of the phone camera, and people with different heights can cause variations of the head position detected by the lens. This meant that sometimes squats could not be detected. To do this, I measured a series of head and hips Y global position value in standing and squat positions across different camera angles and compare the difference using samples taken from three volunteers of different heights. Using this data, I formulated in Excel the optimum squat trigger distance from the player's head position in a standing state.

For all this to work, a countdown timer and distance validation is required so that the player can get in a ready position before the challenge begins, and upon countdown finish the lens would take a snapshot of the ready position and adjust internal configurations accordingly so that the squats can be detected accurately.

Screenshots

Screenshots

Built With

Share this project:

Updates