This project allows you to steer your character by tilting your body, using input from a standard webcam. It detects body landmarks (shoulders) via MediaPipe, calculates the tilt angle, and translates it into virtual gamepad input using vJoy and XOutput.
This provides a hands-free steering solution, ideal for use with spin bikes and other fitness equipment connected via ANT+/Bluetooth sensors for speed/cadence.
- Hands-free steering using body tilt.
- Uses standard webcam, no special hardware required.
- Real-time pose estimation via Google MediaPipe.
- Outputs to a virtual DirectInput device (vJoy).
- Uses XOutput to translate DirectInput to XInput for game compatibility.
- Configurable sensitivity, deadzone, and calibration via the GUI.
You have three main ways to install and use Bodysteer:
- Easy Installation (Recommended for Most Users): Download a pre-built executable. This is the simplest way to get started.
- Manual Installation (For Developers or Customization): Clone the repository and set up a Python environment. This is for users who want to modify the code or contribute.
- Easy Installation without joystick drivers (GTA V only): Download a pre-built executable and a Script Hook V .NET script.
Prerequisites:
Before you begin, ensure you have the following software:
- vJoy Driver: Creates the virtual DirectInput joystick.
- Download vJoy (Install this driver).
- ViGEmBus Driver: Required by XOutput to create virtual Xbox controllers.
- Download ViGEmBus (Download and run the
ViGEmBus_Setup_x64.msi
or similar installer).
- Download ViGEmBus (Download and run the
- XOutput: Translates vJoy's DirectInput to XInput.
- Download XOutput (Download
XOutput.zip
, extractXOutput.exe
somewhere convenient).
- Download XOutput (Download
Hardware:
- A PC capable of running your game.
- A standard webcam positioned to see your upper body/shoulders clearly.
- (Optional) Your bike setup with Bluetooth/ANT+ sensors.
Installation Steps:
-
Download Bodysteer Executable:
- Go to the Bodysteer GitHub Releases page.
- Download the latest
bodysteer
file. - Place the downloaded
bodysteer.exe
file somewhere convenient on your computer.
-
Install Drivers:
- Install the vJoy driver (downloaded from prerequisites).
- Install the ViGEmBus driver (downloaded from prerequisites).
-
Place XOutput:
- Ensure you have downloaded and extracted
XOutput.exe
(from prerequisites) to a known location.
- Ensure you have downloaded and extracted
-
Proceed to the Configuration section below.
Prerequisites:
Before you begin, ensure you have the following hardware and software:
Hardware:
- A PC capable of running the game and Python script simultaneously.
- A standard webcam positioned to see your upper body/shoulders clearly.
- (Optional) Your bike setup with Bluetooth/ANT+ sensors.
Software:
- Python: Version 3.9+ recommended (3.12 was used for recent builds). Download Python (Make sure to check "Add Python to PATH" during installation).
- vJoy Driver: Creates the virtual DirectInput joystick. Download vJoy (Install this driver).
- ViGEmBus Driver: Required by XOutput to create virtual Xbox controllers. Download ViGEmBus (Install this driver before using XOutput).
- XOutput: Translates vJoy's DirectInput to XInput. Download XOutput (Download the application).
- Git: (Optional, for cloning the repository). Download Git.
Installation Steps:
-
Clone Repository:
- Open a terminal or command prompt.
git clone https://github.com/cheneryal/bodysteer.git
cd bodysteer
- (Alternatively, download the ZIP file from GitHub and extract it.)
-
Install Drivers:
- Install the vJoy driver.
- Install the ViGEmBus driver.
-
Set up Python Environment (Recommended):
python -m venv venv
- Activate the environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install Python Dependencies:
- Install the required Python libraries:
python -m pip install -r requirements.txt
- Install the required Python libraries:
-
Place XOutput:
- Place the downloaded
XOutput.exe
file somewhere convenient (it doesn't need to be in the project folder, but you need to know where it is).
- Place the downloaded
-
Proceed to the Configuration section below.
Hardware:
- A PC capable of running GTA V (and optionally GTBikeV).
- A standard webcam positioned to see your upper body/shoulders clearly.
- (Optional) Your bike setup with Bluetooth/ANT+ sensors.
Installation Steps:
- Go to the Bodysteer GitHub Releases page.
- Download the latest
bodysteer
file. - Place the downloaded
bodysteer.exe
file somewhere convenient on your computer. - Download the script Steer.3.cs and place it in the
Grand Theft Auto V\Scripts
folder. - The script requires Script Hook V and Script Hook V .NET which should be already installed if you use GTBikeV.
- Proceed to step 2 of Configuration section below (the other steps are not necessary).
(These steps are common for both Easy and Manual installations)
- Configure vJoy:
- Run "Configure vJoy" from your Start Menu.
- Ensure Device 1 is enabled.
- Check the "X" axis under "Axes". You can leave other axes/buttons unchecked.
- Click "Apply".
-
Run Bodysteer Application:
- Position your webcam so it has a clear, stable view of your shoulders while you are on the bike in your normal riding position.
- Ensure good, consistent lighting. Avoid strong backlighting.
- For Easy Installation: Double-click the
bodysteer.exe
file you downloaded. - For Manual Installation:
- Ensure your Python virtual environment is activated (e.g.,
venv\Scripts\activate
). - Navigate to the
bodysteer
project directory in your terminal. - Run
python main_gui.pyw
or simply double-click themain_gui.pyw
file.
- Ensure your Python virtual environment is activated (e.g.,
- The Bodysteer GUI window will appear.
- From the dropdown menu, select your camera device.
- Click Start Camera.
- Click 'Start Calibration':
- On your bike, look straight at the camera (neutral position) and press 'Calibrate: Look Straight'.
- Tilt your body all the way to the left and click 'Calibrate: Tilt LEFT'.
- Finally, tilt your body all the way to the right and click 'Calibrate: Tilt RIGHT'.
- Set the Deadzone and Sensitivity using the sliders.
- Click 'Save Config' to save these settings for future sessions.
-
Configure XOutput:
- Run
XOutput.exe
. You may need to grant firewall access. - Click "Add controller".
- Click "Edit" on the new controller entry.
- In the "Input device" dropdown, select "vJoy Device".
- Under "Left Stick" -> "X Axis":
- Click the configuration button (often looks like
...
or a dropdown). - Select "Axis X" (or the corresponding axis number from vJoy, usually the first one listed).
- Click the configuration button (often looks like
- (Verification - Optional): While Bodysteer is running and calibrated, tilt your body. You should see the input bar for this axis move in XOutput.
- Click "Save configuration".
- Go back to the main XOutput window.
- Run
- Configure Steam (or Game Launcher):
- Disable Steam Input (Recommended for many games): In your Steam Library, right-click your game -> Properties -> Controller -> Set "Override for ..." to "Disable Steam Input". This prevents conflicts.
- In-Game: Launch your game. Go to Settings -> Controller. Ensure the input method is set to "Gamepad" or "Controller". The game should now recognize the virtual "Xbox 360 Controller" created by XOutput.
- Connect Webcam: Ensure your webcam is connected and positioned correctly.
- Run Bodysteer Application:
- Easy Installation: Double-click
bodysteer.exe
. Select camera, click Start Camera. Load config if saved, or calibrate. - Manual Installation: Activate virtual environment, run
python main_gui.pyw
(or double-clickmain_gui.pyw
). Select camera, click Start Camera. Load config if saved, or calibrate. - Keep the Bodysteer window open.
- Easy Installation: Double-click
- Run XOutput:
- Start
XOutput.exe
. - Click "Start" next to your configured vJoy controller. You should hear the Windows device connect sound. Keep XOutput running.
- Start
- Launch Game: Start your game (e.g., via Steam).
- Ride! Your body tilts should now control steering in the game.
Stopping:
- Close the Game.
- In XOutput, click "Stop" next to the controller and then close XOutput.
- Close the Bodysteer application window.
- (For Manual Installation) If you used a terminal, you can deactivate the virtual environment (
deactivate
).
- Game Doesn't Detect Controller:
- Ensure XOutput is Started (controller shows green) before launching the game.
- Verify ViGEmBus driver is installed correctly.
- Confirm Steam Input is Disabled for the game if applicable.
- Check
joy.cpl
(Windows "Set up USB game controllers"): You should see both "vJoy Device" and "Xbox 360 Controller for Windows". Test the Xbox controller properties page - does the X axis move when you tilt (with Bodysteer and XOutput running)? - Disconnect all other physical gamepads.
- Steering is Jittery/Unstable:
- Improve lighting conditions (ensure good, even lighting, avoid backlighting).
- Ensure a stable background behind you.
- Increase the Deadzone value in the Bodysteer GUI.
- Recalibrate in Bodysteer GUI.
- Steering is Too Sensitive / Not Sensitive Enough:
- Adjust the Sensitivity value in the Bodysteer GUI.
- Recalibrate in Bodysteer GUI, ensuring you capture your full tilt range.
- XOutput Error / ViGEmBus Not Found:
- Reinstall the ViGEmBus driver. Ensure you installed the correct version and restarted if prompted.
- Bodysteer Application Error / Doesn't Start (Easy Install):
- Ensure vJoy and ViGEmBus drivers are installed.
- Try running
bodysteer.exe
as an administrator (right-click -> Run as administrator). - Check if your antivirus is blocking the application.
- Python Script Error (Manual Install):
- Make sure all dependencies in
requirements.txt
are installed in your active virtual environment (python -m pip install -r requirements.txt
). - Check webcam connection and permissions. Ensure the correct camera is selected in the GUI.
- Make sure all dependencies in
- No Camera Feed / "Error opening video source":
- Ensure the correct camera is selected from the dropdown in the Bodysteer GUI.
- Verify the webcam is not being used by another application.
- Check webcam drivers and connection.
- Bodysteer takes too long to detect camera:
- Access Control Panel > System > Advanced system settings > Advanced > Environment variables.
- Add a new environment variable
OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS
with value0
.
Contributions are welcome! Feel free to open an issue or submit a pull request for improvements, bug fixes, or new features.
This project is licensed under the MIT License - see the LICENSE
file for details.