Welcome to the Joychair Interface project! This project integrates the movements of an Aeris Swopper chair into virtual reality (VR) environments, allowing users to navigate virtual worlds by shifting their weight on the chair. The idea is inspired by the concept of ChairIO, as described in the paper "ChairIO - the Chair-Based Interface".
The Joychair Interface project is developed at the iXperience Lab of the Faculty of Computer Science and Business Information Systems. The goal is to capture the movements of the Aeris Swopper chair and integrate them into a solution that can be used within VR environments, particularly in Unity.
The project was developed using the PlatformIO plugin for VSCode. The libraries used are also available for ArduinoIDE. The recommended version for wireless support is the ESP32 version; for wired, use the Arduino one.
- M2.5 Machine Screws and Nuts
- 2000mAh Battery
- SPDT Slide Switch
- JST-PH (Male)
- JST-PH (Female)
- JST-PH extension cable (optional but helpful)
- Buzzer (active or passive)
- RGB LED (optional LED)
- MPU6050 (Inertial Measurement Unit)
- Compatible microcontroller (e.g., ESP32, Arduino)
The project uses microcontroller boards with an IMU sensor attached to the chair. The IMU captures the chair's movements, which are then transmitted wirelessly or via wired connections.
In Unity, the output is used to control the user's movement within the VR environment. By shifting their weight on the chair, users can navigate virtual worlds seamlessly.
To set up the Joychair Interface project, follow these steps:
- Hardware Setup: Attach the IMU sensor to the Aeris Swopper chair as per the instructions provided.
- Microcontroller Configuration: Program the microcontroller board to read data from the IMU and transmit it wirelessly or via a wired connection.
- Unity Integration: Import the output into Unity and configure the VR environment to respond to the chair's movements for navigation.
- Optional Casing: For battery integration, follow a rechargeable battery tutorial. CAD for ESP32 is in progress.
The Joychair Interface provides several key functionalities:
- MPU6050 Setup: Initializes the MPU6050 IMU and ensures connectivity. Plays an initialization sound to confirm startup.
- Continuous Monitoring: Checks the connection to the MPU6050 sensor and attempts to reconnect if the connection is lost, ensuring stable operation.
- Sensor Data Acquisition: Reads data from the IMU, including yaw, pitch, and roll.
- Axis Mapping: Maps the processed sensor data to joystick axes (X, Y, Z, RX, RY, RZ) for VR navigation.
- Sitting Detection: Waits for the user to sit by monitoring acceleration in the Z-axis to exceed a threshold.
- Forward Tilt Calibration: Prompts the user to tilt forward to calibrate the forward direction. Plays a success sound upon completion.
- Real-time Axis Mapping: Continuously updates joystick inputs based on chair movement.
- Deadzone Application: Applies deadzones to joystick inputs to filter out noise and minor movements.
- LED Indicators: Uses RGB LED to provide visual status indicators, including connection status and error notifications.
- Buzzer Sounds: Emits sounds for different events such as initialization, errors, success, and setup completion.
- Analog Reading: Reads the battery level via Sparkfun Fuel Gauge
- Jump Detection: Detects rapid acceleration changes to emulate a "jump" button press.
- Recalibration Button: Allows recalibration of the forward direction by pressing a designated button on the microcontroller.
- Reset Button: Allows to reset the microcontroller.
When integrating the Joychair with a VR environment, it is essential to adjust the axis mappings to suit the target application's requirements. The joystick values, derived from the MPU6050 sensor readings, must be mapped within the appropriate intervals for your setup.
The mapping of the pitch, roll, and yaw values to joystick inputs is critical for achieving smooth and intuitive navigation. Depending on the VR application's sensitivity and control scheme, you may need to calibrate the mapping intervals.
-
Define the Mapping Range:
- Determine the minimum and maximum tilt angles corresponding to the joystick's minimum and maximum values. This range should reflect the comfortable and natural tilting limits of the Aeris Swopper chair.
-
Adjust the Intervals:
- Modify the code to map the sensor readings to the joystick values. Ensure the mapping intervals match the expected input range of your VR application. For instance, if your application expects joystick values from 0 to 32767, you need to map the sensor's tilt range to this interval.
-
Minimum Tilt Threshold:
- Set a minimum tilt threshold to ensure that only intentional movements result in joystick input. This threshold helps filter out minor, unintentional shifts and maintains a stable VR navigation experience.
// Define the minimum and maximum tilt angles (in degrees)
const float minTiltAngle = -10.0;
const float maxTiltAngle = 10.0;
// Define the joystick input range
const int joystickMinValue = 0;
const int joystickMaxValue = 32767;
// Function to map tilt to joystick value
int mapTiltToJoystick(float tiltAngle) {
return map(tiltAngle, minTiltAngle, maxTiltAngle, joystickMinValue, joystickMaxValue);
}
// Example usage in the main loop
void loop() {
// Get the tilt angles from the MPU6050
float pitch = ...; // Get the pitch angle
float roll = ...; // Get the roll angle
// Map the tilt angles to joystick values
int joystickX = mapTiltToJoystick(pitch);
int joystickY = mapTiltToJoystick(roll);
// Apply the mapped values to the joystick
bleGamepad.setAxes(joystickX, joystickY, ...);
}
LED Blink Red: Battery below 20%
LED Blink Yellow: Battery over 20%
LED Blink Green: Battery over 50%
- Aeris Swopper Product Page: Learn more about the Aeris Swopper chair.
- Arduino Joystick Tutorial: Useful guide for setting up the Arduino Leonardo as a joystick.
- MPU6050 Wiring Guide: How to wire MPU6050
- Buzzer Wiring Guide: How to wire a buzzer
- RGB-LED Wiring Guide: How to wire an RGB-LED
- Rechargeable Battery Integration: How to wire a rechargeable battery
- Sam Weiler (@zamweis)
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to reach out to the project team for any questions or feedback. Happy navigating in VR with Joychair Interface! ๐ฎ๐ช๐