Mini projet: a brain-controlled robot.
3 parts so far:
Neural signals to guide the robots are captured here. They fall into one of those 4 categories:
- Turn left
- Turn right
- Go forward
- Do nothing (default)
Those signals are direct neural electric signals captured by electrodes on a man's head. Signals are grouped into fixed-length buffers and sent to the next layer:
Once a satisfactory sample has been recorded, it's sent to an analyzer layer. This layer must determine the action that is being ordered by the man. Each action corresponds to a signal with a certain defined frequency (they actually come from staring at flashing lights). The analyzer thus conducts a frequency analysis of the given sample and then decides what action to send to the next layer:
The robot is given an order and must then execute it. For now, we'll do with a robot's simulation and an Arduino Serial communication.
This project was made using Python 3.6: please make sure to install the interpreter before running the code.
3 non-standard libraries were used: to install them, simply run pip install -r ./requirements.txt
from the source folder.
You are given 2 options for running the code: either on a single machine or on different ones. In the latter case, please be sure to specify the right IP addresses of your machines when interconnecting the different components (localhost
by default).
3 main Python scripts should be detailed:
streamer.py
parses a .txt
recording and sends it to an analyzer via a socket.
How to start:
python streamer.py
analyzer.py
parses the buffers received from the Streamer and analyzes them. It then sends an action to an actioner via another socket.
It uses functions from helpers.py
, located in the utils folder.
How to start:
- Start the Streamer
python -i analyzer.py
analyzer.connect()
analyzer.run()
actioner.py
parses the actions received from the Analyzer and executes them. So far it uses turtle to mock the robot and sends serial communications to an Arduino board.
How to start:
- Start the Analyzer
python -i actioner.py
actioner.connect()
actioner.run()
Docstring is available for those 3 modules, just use help(ClassName)
to get info on any of those classes (doc coming soon).
The Actioner sends signals over a specified Serial USB port (COM7
by default) at a certain BaudRate (9600
by default), expecting to reach an Arduino board programmed to read those signals.
Such a code is provided in the arduino folder: this code can be televersed on an Arduino Uno board using the Arduino IDE and matching the following schematics for pin-outs: