Through a review of the VNect model’s logic, we identified why our initial version struggled with maintaining accurate coordinate to avatar mappings. The original implementation lacked neccessary handling of each joint’s parent-child hierarchy and inverse rotations, resulting in misaligned bones and distorted movements. By setting up each JointPoint with a clear parent-child relationship and applying inverse rotations, we can maintain the natural orientation of each bone in the skeletal structure. However, implementing this solution presents its own challenges. While we now understand the corrective adjustments needed for accurate joint mapping, effectively coding and integrating these changes into the existing framework requires careful calibration.
NOV 9
This week, we implemented the MediaPipe landmark-to-Unity game avatar algorithm, achieving a milestone in our project. Our approach involves mapping key joint landmarks captured by MediaPipe to the corresponding parts of the Unity avatar. We used a dictionary that aligns MediaPipe joints with their Unity counterparts. By employing quaternion inversions and transformations, the algorithm dynamically adjusts joint rotations, enabling realistic rotations based on each joint’s calculated 3D orientation. Additionally, we used vector lerping to create a smoothing effect, which minimizes jitter and enhances the avatar’s fluidity in response to the player’s motions.
Check out the link below for a short demo.
https://drive.google.com/file/d/12WlJTbA2-HPqiBN8q2q5dFiIJFpqSk_l/view?usp=drive_link
We also discovered that the PCB connects to the wrong pin on the Arduino for power, but this can be fixed on the board by the addition of a single jumper wire, without the need to redesign/print a new board.
NOV 16
For validation, we need to ensure that our entire pipeline is smooth and responsive. All user gestures should be detected properly by our camera and properly translated to our game environment, and our game environment must be able to transmit a signal to our physical device triggering a detectable vibration. All of this must be done with little delay to ensure our game is as responsive as possible. To accomplish this, we will first test our in-game detection. We will have a user throw a large number of punches and measure how many of them are registered by our system, aiming for a target detection accuracy of >= 95%, adjusting our computer vision code if necessary. We will also have a test user throw punches with the watch on their wrist, having them determine whether or not there is a noticeable delay between their punch and the haptic feedback, adjusting our python/arduino code if necessary.
The first tests that were run for the video game portion of the project were tests involving the colliders and collision detection of the player character. First, tests were done in a simple environment with the debug console to check whether the colliders on the fists of the player were detected to have collided with a simple collider on a wall. Past that, the tests went into checking whether collision could be detected with an enemy player model. These tests checked whether the separate collisions could be detected for the player’s hands hitting the body, head, and arms of the enemy. Later damage calculation scripts were tested as well to dynamically apply damage to the enemy and player depending on where one was hit and verification that the HP slider’s connected to the player and the enemy moved down correspondingly.
Next tests were done with the environment of the boxing ring to make sure that there were no bugs that allowed a player to get stuck in the environment or be able to move through the boxing ring. The latest testing involved the integration of the computer vision and the game and being able to verify that our character model was properly able to be able to be set to a humanoid rig, which our computer vision movement code required.
Some later tests that will be done involve our use case requirements regarding the game FPS and ping. These will need to be at least meeting our use case requirements. More testing will also be done on the robustness and speed of the character in game based on the computer vision movement.
NOV 30
This week, we met up a few times to fully integrate and test the full pipeline. We first individually made sure each portion and any added capabilities, such as the automatic enemy attacking script for the game, were working properly. Then we integrated and tested the computer vision controls with the video game. A distance of a few feet back is needed for the computer vision to fully see the entire body and the movement translation to be smoother. We were able to see success with the movement in the game and tested around different camera angles to allow the player to better tell what’s going on. Next we tested the integration between the vibrating watch and the video game and were able to find success with that as well. The two different types of vibrations which are dependent on whether the enemy lands a hit or the player lands a hit both were functional. Lastly, we verified that the entire pipeline was functional with UDP communication from the python script with computer vision to unity and the other line of UDP communication from Unity towards the watch python script at the same time.
Through this process, we were testing to make sure we met our use case requirement metrics that were previously set. The game was able to meet the FPS requirement of greater than or equal to 40, as well as the ping requirement of less than or equal to 50 ms between the computer vision python script and unity. Without any added time constraints such as the time it takes for the motor to turn for the vibration on the watch, the total time it takes for the entire pipeline was also under 100ms. We are well on track and will be adding more details to our testing for the upcoming presentation.
DEC 7
Unit Tests and Overall System Tests Conducted:
Watch Testing
1.Weight Test
•Purpose: Measure the weight of the watch, with and without the battery.
•Target: 100 g (comparable to an average watch).
•Result: The watch weighed 53 g, significantly lighter than the target.
2.Vibration Test
•Purpose: Test the vibration capability to ensure distinct levels can be felt.
•Target: Two distinct levels of vibration.
•Result: Achieved two distinct levels successfully.
3.Power Test
•Purpose: Measure the watch’s power consumption during idle and vibration states.
•Target: 1.2 A maximum current for ensuring ~20 minutes of operation with a 400 mAh battery.
•Result: Measured between 50 mA (idle) and 77 mA (vibrating), well below the target, enabling longer operation time.
4.Distance Test
•Purpose: Measure the maximum Bluetooth connectivity distance.
•Target: 3 meters (aligned with expected gameplay range).
•Result: Achieved 20+ meters, far exceeding the target range.
5.Ping Test
•Purpose: Measure the delay in Bluetooth signal transmission between Python and Arduino.
•Target: ≤ 30 ms.
•Result: Achieved a delay of 22 ms, within the target range.
Computer Vision Testing
1.Accuracy Test
•Purpose: Measure accuracy of avatar movements corresponding to real human gestures.
•Target: At least 80% accuracy with < 10-degree differences in joint angles in 80% of timestamps over five frames.
•Result:
•Front View: 92.5% accuracy.
•Side View: 84.5% accuracy.
•Top View: 70.25% accuracy (underperformed due to MediaPipe’s depth estimation limitations).
•Observations: Top-view accuracy was limited by hardware and depth sensing constraints.
Video Game Testing
1.Frame Rate Test
•Purpose: Ensure smooth gameplay with no frame drops below 40 FPS.
•Result: Achieved 50 FPS on a lower-end laptop and 250 FPS on a desktop.
2.Latency Test
•Purpose: Measure delay between human movements and avatar response.
•Target: ≤ 50 ms latency.
•Result: Achieved a latency of 35 ms, well within the acceptable range.
3.Hit Detection Test
•Purpose: Verify hit detection and dynamic damage calculations based on hit location.
•Result: Passed, with the system accurately detecting hits and calculating damage properly.
Findings and Design Changes:
1.Watch Design
•The weight of the watch (53 g) was lighter than the target, improving comfort for the user.
•Power consumption was significantly lower than anticipated, enabling prolonged gameplay.
•No changes required as results exceeded expectations.
2.Computer Vision Accuracy
•Top-view mapping accuracy (70.25%) highlighted limitations in MediaPipe’s depth estimation.
•Recommendation: Implement a depth camera in future iterations to improve accuracy for 3D tracking.
3.Video Game Performance
•Both latency (35 ms) and frame rate (50 FPS on low-end devices) met targets, ensuring smooth and responsive gameplay.
•No additional changes needed for the current setup.