<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Emeric Van Frausum</title>
    <description>The latest articles on DEV Community by Emeric Van Frausum (@haracks).</description>
    <link>https://dev.to/haracks</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4277161%2F8bcda185-3847-43bc-8d71-3e4ce82bcf46.png</url>
      <title>DEV Community: Emeric Van Frausum</title>
      <link>https://dev.to/haracks</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/haracks"/>
    <language>en</language>
    <item>
      <title>My body is the controller: I built a webcam workout for GTA 6's gym</title>
      <dc:creator>Emeric Van Frausum</dc:creator>
      <pubDate>Tue, 01 Dec 2026 21:58:35 +0000</pubDate>
      <link>https://dev.to/haracks/my-body-is-the-controller-i-built-a-webcam-workout-for-gta-6s-gym-4lm9</link>
      <guid>https://dev.to/haracks/my-body-is-the-controller-i-built-a-webcam-workout-for-gta-6s-gym-4lm9</guid>
      <description>&lt;p&gt;Why am I still at 17% of GTA 6? Because every time Jason goes to the gym, I go too 😄&lt;/p&gt;

&lt;p&gt;I built a small system where &lt;strong&gt;my body is the controller&lt;/strong&gt;: a webcam watches me do pull-ups, kettlebell swings, squats and shadow boxing, and turns every rep into button presses on the PS5. No mod, no sensors on my body, just a camera.&lt;/p&gt;


&lt;div&gt;
    &lt;iframe src="https://www.youtube.com/embed/l-TfZ2qLQEk" width="315" height="560"&gt;
    &lt;/iframe&gt;
  &lt;/div&gt;


&lt;p&gt;Here's how it works, and the problems I didn't expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pipeline
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;📷 &lt;strong&gt;A phone used as a webcam&lt;/strong&gt; films me at 30 fps.&lt;/li&gt;
&lt;li&gt;🧠 &lt;strong&gt;RTMPose&lt;/strong&gt; (pose estimation, running on my NVIDIA GPU) finds my joints in every frame: shoulders, elbows, wrists, hips, knees.&lt;/li&gt;
&lt;li&gt;🐍 &lt;strong&gt;A Python engine&lt;/strong&gt; turns those joints into reps: a swing, a squat, a pull-up.&lt;/li&gt;
&lt;li&gt;🎮 &lt;strong&gt;A virtual controller&lt;/strong&gt; (vgamepad + ViGEmBus) presses the buttons GTA 6 wants: L2 + R2 for each rep, X when Jason struggles.&lt;/li&gt;
&lt;li&gt;📡 &lt;strong&gt;Veyra&lt;/strong&gt; (a PS5 Remote Play client) sends it all to the PS5.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From camera frame to button press, the PC side takes only a few milliseconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Counting reps without fake reps
&lt;/h2&gt;

&lt;p&gt;Raw pose data shakes a little from frame to frame. If you count "hands went up, hands went down" naively, you get fake reps every time you wobble at the top.&lt;/p&gt;

&lt;p&gt;What worked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Smoothing first.&lt;/strong&gt; The joint positions are filtered before anything else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A clear up/down state per exercise, with hysteresis.&lt;/strong&gt; A direction only switches after a real move, about a third of your own range. Wobbling at the top doesn't count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A posture check before anything counts.&lt;/strong&gt; For pull-ups, you have to be hanging with your hands above your head; for squats, standing with your hands up at a bar. Walking around the room never triggers a rep.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distances measured in your own body.&lt;/strong&gt; Movements are measured in arm or torso lengths, not pixels, so it works whether you stand close to the camera or far away.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My pull-up bar is in a doorway with stairs behind it, so I had to film myself &lt;strong&gt;from behind and below&lt;/strong&gt;. The pull-up logic had to work from that angle too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pressing the triggers like a human
&lt;/h2&gt;

&lt;p&gt;Counting reps turned out to be only half the job. GTA 6's gym doesn't want a simple button tap: you hold L2 + R2, press harder on the way up, and release to go down.&lt;/p&gt;

&lt;p&gt;So I recorded myself doing the exercise with the &lt;strong&gt;real controller&lt;/strong&gt; and logged how I pressed the triggers. Then I copied that shape:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the triggers press down over about half a second as I start going up,&lt;/li&gt;
&lt;li&gt;they're fully pressed by the top,&lt;/li&gt;
&lt;li&gt;held while I stay there,&lt;/li&gt;
&lt;li&gt;and eased off as I go back down.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The game also asks you to mash X when the character struggles near the end of a set. I simply mash X from the first rep: it's harmless earlier and saves a missed rep later.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug that wasn't mine
&lt;/h2&gt;

&lt;p&gt;For a whole evening, L2 and R2 never reached the game &lt;em&gt;together&lt;/em&gt;. Each one alone worked; both at once, never.&lt;/p&gt;

&lt;p&gt;After a lot of testing, the culprit was the Remote Play client: the version I used kept only the &lt;strong&gt;newest&lt;/strong&gt; input change in each network packet, so when both triggers changed at the same moment, one was lost. Updating Veyra fixed it instantly. Lesson learned: build a small test tool early. Mine presses the virtual triggers through a fixed sequence so I can check the whole chain without the camera.&lt;/p&gt;

&lt;h2&gt;
  
  
  A voice coach for the training drills
&lt;/h2&gt;

&lt;p&gt;To tune the thresholds, I record &lt;strong&gt;drills&lt;/strong&gt;: guided sessions where I do each exercise a few times from different angles. Since I can't look at the screen during pull-ups, the drills have a &lt;strong&gt;coach's voice&lt;/strong&gt; (made with ElevenLabs) that tells me when to start, which move to do, and when I'm done.&lt;/p&gt;

&lt;h2&gt;
  
  
  What still lags
&lt;/h2&gt;

&lt;p&gt;At 1:13 in the video, I finished my 13th pull-up but the game didn't count it. Jason was tired and still slowly pulling himself up while I was already back down, so the triggers were released too early.&lt;/p&gt;

&lt;p&gt;The tracking is fine; the game just slows the character down at the end of a set. Next step: keep the triggers held until Jason catches up, either with a longer hold near the end of a set or by reading the game screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;This is Tier 0: a webcam and some Python. The plan goes further: small motion sensors (ESP32 + IMU) worn on the body, talking directly to a PlayStation Access controller, with the goal of every action reaching the PS5 &lt;strong&gt;within 10 ms&lt;/strong&gt; of my first move. That's fast enough for running, jumping and shooting, not just the gym.&lt;/p&gt;

&lt;p&gt;Side effect of building all this: I lost 1.5 kg 😄&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built with the help of Claude Code. Dressing like Jason is totally optional.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gamedev</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
  </channel>
</rss>
