Head over to our Wiki Home to find out on how to setup the dance prediction system. Below describes the various components of the system and their integration as a dance prediction system.
Important Files:
- Power.ino - Includes power-relevant code from the main ArduinoClient.ino file. Contains code segments detailing:
- Power reading
- Power calculations
- Arduino subsystem power saving measures
- Sensor.ino - Includes sensor-relevant code before integration into the main ArduinoClient.ino. The code performs the following:
- Initializing the sensors
- Getting the raw sensor values
- Processing the sensor values
- Print it on Serial Terminal Note: Use this to test that the sensors are working as expected, using the Serial Monitor of Arduino
Important Files:
- ArduinoClient.ino - Responsible for implementation of FreeRTOS by Richard Barry to prioritise, schedule and execute the following tasks:
- Reading data from sensor and power periodically
- Parses and format the data to send in packet
- Transmit data via wired UART connection to the Raspberry Pi
- RpiClient.py - Responsible for setting up UART connection between Arduino Mega and Raspberry Pi, socket connection between the Raspberry Pi and the Server, and scheduling the following threads:
- ReceiveData Thread: Receive packet from the Arduino Mega and store into Circular Buffer
- StoreData Thread: Process data received in Circular Buffer correctness using checksum and store into list for MachineLearning thread
- MachineLearning Thread: Predict move using the list and send it via secure, encrypted socket to the server
- CircularBuffer.py - Implementation of array of size 30, the sample size needed for the prediction of a single dance move. Used by the ReceiveData thread to store the raw string packet received from the Arduino Mega immediately for later processing by the StoreData thread
- RF.py - Model training for realtime training of model for dance prediction
Important Files:
- IndividualMoves.py (deprecated) - Segment training data into individual moves as training data contains multiple dance moves
- SlidingWindow.py - Segment the training data in sliding windows of 50%. Also to aggregate extracted data
- FeatureSelection.py - Select important/most correlated features to use for training/testing
- Machine Learning Models (i.e. KNN.py, SVM.py, NN.py, RF.py) - Run models on Rpi, to generate and serialise model into Pickle file
- Pickle Files (i.e. KNN.pkl, SVM.pkl, NN.pkl, RF.pkl) - Pre-trained machine learning model, loaded for prediction
Important Files:
- ArduinoClient.ino - Same as in Communications Folder, with the integration and optimisation of reading sensor and power data from the Hardware Folder
- RpiClient.py - Same as in Communication Folder, with the integration and optimisation of machine learning thread from the Software Folder
- CircularBuffer - Same as in Communications Folder