Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Our team was inspired to develop this project by our aspiration to bridge the di

# Getting Started
- Please refer to our [Hardware Setup Guide](./hardware/README_HARDWARE.md) for instructions on setting up the hardware.
- Please refer to our [Software Setup Guide](./Virtual%20Environment/README_SOFTWARE.md) for instructions on setting up the software.
- Please refer to our [Software Setup Guide](./mainmenu/README_SOFTWARE.md) for instructions on setting up the software.
<br></br>

# Current State of the Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from panda3d.core import AmbientLight, DirectionalLight

def GenerateModel(self, position, scale, hpr, parent, path):

model = self.loader.loadModel(path)
model.setPos(*position)
model.setScale(*scale)
Expand Down
10 changes: 6 additions & 4 deletions Virtual Environment/main.py → VirtualEnvironment/main_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

load_prc_file('myConfig.prc')

class MyApp(ShowBase):

class MyApp(ShowBase):

xCoord = 0
yCoord = 0
angle = 180
Expand All @@ -28,19 +29,21 @@ class MyApp(ShowBase):
score = 0
star_angle = 0
last_message_time = 0

camera_pos = 0
dir_list = ['left', 'right', 'backward', 'forward']
prev_sec = 0




def __init__(self):

ShowBase.__init__(self)

self.setBackgroundColor(0.95, 2.45, 2.45)

simplepbr.init()


self.accept('d', self.ChangeSpherePositionRightStart)
self.accept('d-up', self.ChangeSpherePositionRightEnd)
self.accept('a', self.ChangeSpherePositionLeftStart)
Expand Down Expand Up @@ -295,7 +298,6 @@ def ChooseDirection(self, task):
self.index = 0



for i in self.obj_coords:

pos_tuple = tuple(pos)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,40 @@
Make sure to install the required Python libraries. Running the command `pip install -r requirements.txt` will download each of the required libraries to successfully execute this project.


# Virtual Environment
# Main Menu

To run the main menu: Execute `python mainmenu/menu.py`

This menu presents 3 options, each pertaining to a particular game. They are the following:

## Virtual Environment

<p align="center">
<img src="../Documents/venv.png" style="width:50%;">

</p>

To run the virtual environment: Execute `python /Virtual Environment/main.py`
To run the virtual environment: Execute `python Virtual\ Environment/main.py`

The main objective is to collect as many stars within a given timeframe.

A user may control the object using data received from the EEG, or can modify the functions to accept key inputs. See <a href="https://docs.panda3d.org/1.10/python/programming/index">Panda3D Documentation.</a >

# 2D Game
## 2D Game

<p align="center">
<img src="../Documents/2d_game.png" style="width:20%"> </img></div> </p>

The main objective of this game is to keep the black box within the green bar for as long as possible. The EEG will use power density concentration measurements to determine the adqueate placement of the black box. The higher the concentration, the higher the box will go up the red bar.

# 30s Game
## 30s Game

Almost identical to the 2D Game, except there is a 30 second timer as well as random placement of the green box every 5 seconds.


# Data Collection GUI

To run GUI: Execute `python /Data\ Collection/main.py`
To run GUI: Execute `python Data\ Collection/main.py`

The GUI presents 2 options. Selecting "Imagery" will assume that the EEG will be classifiyng motor-imagery tasks. Selecting "Real" implies the actual movement of the instructed task.

Expand Down
55 changes: 55 additions & 0 deletions mainmenu/menu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import tkinter as tk
import sys
import os


class MainMenu(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack(expand=True)
self.create_widgets()

def create_widgets(self):

self.button_frame = tk.Frame(self)
self.button_frame.pack(expand=True)

self.button1 = tk.Button(self.button_frame, text="Run Virtual Environment", command=self.run_venv)
self.button1.pack(side="top", pady=10)

self.button2 = tk.Button(self.button_frame, text="Run 30s Game", command=self.run_30sgame)
self.button2.pack(side="bottom", pady=10)

self.button3 = tk.Button(self.button_frame, text="Run 2D Game", command=self.run_2dgame)
self.button3.pack(side="top", pady=20)

def run_venv(self):

os.system("python VirtualEnvironment/main_sim.py")

def run_2dgame(self):

os.system("python 2DGame/main.py")

def run_30sgame(self):

os.system("python 30s\ Game/main.py")

if __name__ == '__main__':
root = tk.Tk()

root.title("Main Menu")

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
window_width = 300
window_height = 200
x_pos = (screen_width - window_width) // 2
y_pos = (screen_height - window_height) // 2

root.geometry("{}x{}+{}+{}".format(window_width, window_height, x_pos, y_pos))
app = MainMenu(master=root)
app.mainloop()

exit(0)