Skip to main content
QIM SDK · Qualcomm
Gesture Recognition

A split-screen touchless driving game controlled entirely by wrist movement, built on a two-stage palm detection and hand landmark pipeline running on Qualcomm QIM SDK with QNN HTP acceleration.

QIM SDK Team·Aug 3, 2026·← All posts

Introduction

“TouchlessDrive” is a touchless car game that turns a player’s raised hands into a virtual steering wheel. Using a single USB camera, the system tracks both wrists and interprets the line between them as the steering input. When the player tilts their hands left or right, the on-screen car responds in real time. The experience is displayed in a split-screen layout, with the live camera feed shown alongside the game interface. Under the hood, TouchlessDrive runs on a two-stage hand-tracking pipeline built with the Qualcomm QIM SDK. First, a palm detection model identifies each hand in the frame. Then, a hand-landmark model extracts precise keypoints, including the wrist locations used for steering. Both models run through the QNN TFLite delegate, offloading inference to the on-device HTP instead of the CPU. This helps keep the game loop responsive and capable of real-time performance. The project highlights how the QIM SDK’s metadata pipeline can power interactive application logic beyond traditional video analytics. In TouchlessDrive, AI-generated hand keypoints are transformed directly into game-controller input, enabling a natural, controller-free gaming experience.

Use Case Overview

1

Hand Tracking

Two-stage inference, palm detection followed by hand landmark estimation, locates both of the player’s hands and extracts their wrist keypoints every frame.
2

Virtual Steering Wheel

The line connecting the two wrist points is treated as a steering wheel. Its tilt angle, measured relative to horizontal, becomes the steering input.
3

Steering-to-Motion Mapping

The tilt angle is converted into a clamped steering value that moves the on-screen car left or right, with smoothing applied to avoid jittery motion.
4

Split-Screen Rendering

The display is divided into two halves: the left shows the raw camera feed with hand-tracking overlays, and the right renders the game itself, including the road, car, obstacles, and score.
5

Game Loop

Obstacles spawn and scroll down the game lane; a collision ends the run and briefly shows a crash state before the game automatically resets.

Pipeline diagram

Touchless Wrist Steering Car Game Pipeline

Elements used in pipeline

How it works

1

Capture and Mirror

The USB camera feed is flipped horizontally so on-screen motion matches the player’s real-world hand movement, then formatted to a fixed resolution and frame rate for the rest of the pipeline.
2

Two-Stage Hand Tracking

Palm detection runs first, locating each hand’s bounding region. qtimetatransform uses the roi-palmd module to convert each detected region into an aligned crop, which the hand landmark model then processes to extract per-hand keypoints, most importantly the wrist.
3

Wrist Extraction

An appsink callback receives the landmark metadata for every frame and pulls out the wrist keypoint (keypoint ID 0) for each tracked hand. When two hands are present, the pair with the largest horizontal separation is selected as the active steering pair.
4

Steering Angle Calculation

The angle of the line between the two wrist points is computed and mapped to a steering value clamped to a fixed range, then smoothed across frames so small tracking jitter doesn’t translate into an erratic car.
5

Game Update

Each frame, the steering value nudges the car’s horizontal position, obstacles advance down the lane, and a collision check runs against the car’s current position. A collision triggers a brief crash state and increments state that leads to an automatic restart.
6

Split-Screen Composition

A Cairo drawing callback renders both halves of the display in a single pass: the left half shows the camera feed with the tracked wrist line and a steering-wheel indicator overlaid, and the right half draws the road, car, obstacles, and score.

Setup Requirements

Hardware

HW Setup

Software

Flash your Qualcomm Edge device by following the device setup and flashing instructions here, then install the Python and GStreamer prerequisites (python3, gstreamer1.0, python3-gi) needed to run the pipeline. The palm detection and hand landmark TFLite models, along with their label and settings files, are the same assets used by the hand gesture recognition pipeline. See that post’s model download steps for the palm and hand landmark model files.
Check application source code on GitHub: demo_car_game/main.ccPre-built application on device: /usr/bin/qimsdk_demo_car_game

Download Required Files

Download the gesture recognizer task bundle from Google MediaPipe to obtain the palm detection and hand landmark models:
If a downloaded model file is a .zip archive, extract it on your host machine before copying: unzip filename.zip
1

Copy Files to Device

2

Connect a USB camera

Connect a USB (UVC) camera to the target device and verify it is exposed as /dev/video2 (update the --input-config value below if your camera is exposed on a different node).
3

Run the application

The application tracks both wrists from the live USB camera feed, mapping their relative tilt to a virtual steering wheel that steers a split-screen driving game in real time.To stop the application, press CTRL + C.

Application Function Breakdown

The TouchlessDrive application is organized into a handful of function groups, each responsible for one stage of the hand-to-steering flow:
  • Metadata parsing: extracts the wrist keypoint (ID 0) for each tracked hand from the raw landmark metadata stream, handling frames where zero, one, or two hands are detected.
  • Steering pair selection: when two hands are present, selects the pair with the largest horizontal separation as the active steering wheel, discarding stray or partial detections.
  • Steering angle calculation: computes the tilt angle of the line between the two wrist points, maps it to a clamped steering value, and smooths it across frames to filter out landmark jitter.
  • Game state and physics: advances the car’s horizontal position based on the current steering value, scrolls obstacles down the lane, runs collision checks, and manages the crash/restart state machine.
  • Rendering: a Cairo drawing callback composes the split-screen output each frame — the camera feed with the wrist line and steering-wheel indicator on the left, and the road, car, obstacles, and score on the right.
  • Pipeline setup: assembles the two-stage palm detection and hand landmark QIM SDK pipeline and wires the appsink callback and Cairo overlay into the runtime before the pipeline starts.

Expected Output

Running the application opens a full-screen split view:
  • Left panel: live camera feed with the tracked wrist-to-wrist line and a steering-wheel indicator overlaid.
  • Right panel: the driving game, including a scrolling road, the player-controlled car, incoming obstacles, and a running score.
Tilting the virtual wheel formed by both wrists steers the car left or right; colliding with an obstacle shows a brief crash state before the game restarts automatically. Press Ctrl+C to stop the application.

Conclusion

TouchlessDrive demonstrates how a two-stage hand-tracking pipeline, accelerated entirely on-device through the QNN HTP, can extend beyond traditional video analytics to enable real-time interactive experiences. The wrist-tracking technique used in the driving game can also be adapted for touchless kiosks, accessibility solutions, and other gesture-based human–computer interaction applications built with the Qualcomm QIM SDK.