# Position Tracking with Embedded Systems

## Introduction

For this project we want to design an embedded system that can track a users position. We want to track their current position on the ground and see how they are shifting their weight. This system will be used to track their position to determine if a user is doing the exercises correctly.

## Objectives

- Design an embedded system that can track user position.
- Develop an algorithm to process the data from the Wii Fit Board and determine the user's position.

## Research and Analysis

### Choosing the Wii Fit Board

For this project we have chosen the Wii Fit Board as our primary sensor. The Wii Fit Board is a balance board that can measure a user's weight and center of balance. It is a low-cost sensor that is easy to interface with a microcontroller. The Wii Fit Board communicates over Bluetooth, which makes it easy to connect to a microcontroller with Bluetooth capabilities.

### Alternative Solutions

There are other sensors that can be used for position tracking, such as pressure sensors or accelerometers. However, these sensors are more expensive and may require additional processing to determine the user's position. The Wii Fit Board provides a simple and cost-effective solution for position tracking.

Example of other sensors that can be used for position tracking:

Pressure sensors:
    - Description: Pressure sensors can be used to measure the force applied by the user on the ground. By measuring the pressure distribution, the user's position can be determined.
    - Pros: High accuracy, can measure force applied by the user.
    - Cons: Expensive, will require additional hardware for data transfer.
    - Cost: ~ 33 euros (https://www.antratek.nl/flexiforce-a401-sensor-25lbs?gad_source=1&gclid=CjwKCAjwupGyBhBBEiwA0UcqaMMrIXGafsF2oE-15JaTPT5tDhfCyDHz2D2gSghyPvg11okv_QIFThoCw5oQAvD_BwE)

Accelerometers:
    - Description: Accelerometers can be used to measure the user's acceleration and orientation. By integrating the acceleration data, the user's position can be determined.
    - Pros: Can measure acceleration and orientation, cheap.
    - Cons: Will require additional hardware for data transfer.
    - Cost: ~ 5 euros (https://www.amazon.nl/versnellingsmeter-gyroscoop-versnellingssensor-converter-gegevensuitgang/dp/B07BVXN2GP/ref=asc_df_B07BVXN2GP/?tag=nlshogostdde-21&linkCode=df0&hvadid=430548884871&hvpos=&hvnetw=g&hvrand=5187253011954678898&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=1010543&hvtargid=pla-928293154057&psc=1&mcid=43bf111afa7b3ba593f4a49321683352)

### System Requirements

To be added 

## System Design

### Hardware

The hardware of the system will consist of the following components:
    - Wii Fit Board: The primary sensor for position tracking.
    - Pepper: The controller that will process the data from the Wii Fit Board.

### Software 

The software of the system will consist of the following:
    - Wiiboard-simple: A library that will be used to transfer data from the Wii Fit Board to pepper.
    - Position Tracking Algorithm: An algorithm that will process the sensor data and determine the user's position.

### Integration

The Wii Fit Board will be connected to Pepper using the Wiiboard-simple library. The library will be used to read the sensor data from the Wii Fit Board and transfer it to Pepper. The position tracking algorithm will process the sensor data and determine the user's position.

Challenge:
    - Connecting to the wii fit board. It is not possible to connect directly to the Wii Fit Board, it is necessary to use a library that can interpret the data sent by the Wii Fit Board.
    - The Wii Fit Balance Board sends data in a specific format. To interpret this data, it's necessary to understand the format and how to convert it to a usable format.
    - The Wii Fit Balance Board uses Bluetooth 2.0 to communicate. Pepper uses Bluetooth 4.0 this means that there might be compatibility issues/latancy issues.

## Implementation

### Prototyping

To start the implementation of the system, we will create a prototype that will read the sensor data from the Wii Fit Board and send it to your computer. Once we have the data, we will develop the position tracking algorithm to determine the user's position. After that, the algorithm will be integrated with pepper.

### Testing and Validation

Tests:
    - Test the prototype to ensure that it can read the sensor data from the Wii Fit Board.
    - Test the position tracking algorithm to ensure that it can determine the user's position accurately.
    - Test the integrated system to ensure that it can track the user's position in real-time.

## Conclusion

To be added

## References

[Wiiboard lib](https://code.google.com/archive/p/wiiboard-simple/wikis/Documentation.wiki)
https://advanti-lab.sb.dfki.de/?page_id=64
https://github.com/paulburton/fitscales
https://github.com/micromu/WiiRemoteJ

## Appendices

To be added