RaceSimRemote transforms your Android device into a virtual remote racing wheel for simulation games. By utilizing your device's high-precision motion sensors, it provides an immersive steering experience, complemented by on-screen controls for essential racing functions.
The app acts as a bridge between your physical movements and the racing simulator.
- Steering: Tilt your device like a steering wheel. The app uses the
TYPE_GAME_ROTATION_VECTORsensor to track your device's pitch in landscape mode, translating it into precise steering input. - Pedals: Two vertical sliders (SeekBars) on the screen act as your throttle and brake pedals. They are designed to auto-reset to zero when released, mimicking the behavior of physical pedals.
- Gears: Dedicated, color-coded buttons allow for quick gear changes (Gear Up/Down).
- Communication: All inputs are aggregated and broadcasted via low-latency UDP packets to your PC or simulation host.
The interface is optimized for landscape use:
| Position | Element | Function |
|---|---|---|
| Left Side | Red Button | Gear Down |
| Vertical Slider | Throttle | |
| Center | Digital Display | Real-time steering percentage and device pitch |
| Right Side | Blue Button | Gear Up |
| Vertical Slider | Brake |
MainActivity.kt: Handles UI interactions, sensor registration (Game Rotation Vector), and coordinate mapping.UdpSender.kt: Encapsulates the network logic, using Kotlin Coroutines to ensure smooth UI performance while streaming data.activity_main.xml: A customRelativeLayoutdesigned for ergonomic "wheel-style" grip.
Data is streamed to port 3000 (default target: 192.168.1.6) using a 16-byte Little Endian packet structure:
| Offset | Type | Description | Range / Mapping |
|---|---|---|---|
| 0 | Int32 | Steering | -32767 (Left) to 32767 (Right) |
| 4 | Int32 | Throttle | 32767 (Idle) to -32767 (Full) |
| 8 | Int32 | Brake | 32767 (Idle) to -32767 (Full) |
| 12 | Int32 | Buttons | 1: Gear Up, 2: Gear Down, 0: None |
- Open the project in Android Studio.
- In
MainActivity.kt, update theUdpSenderinitialization with your computer's IP address. - Deploy the app to your Android device.
- Ensure both the device and the PC are on the same Wi-Fi network.
- On your PC, use a compatible receiver or custom script to map these UDP inputs to your game's controls.