Skip to content

Commit

Permalink
initial commit 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
marionleborgne committed Jun 12, 2016
1 parent dcdadc5 commit 92242f9
Show file tree
Hide file tree
Showing 28 changed files with 1,952 additions and 0 deletions.
661 changes: 661 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- Some things in PikaPublisher related to the buffer can probably be taken
out and placed in the super class.
- Document PikaSubscriber a little better so that it is obvious that the
callback eats data in this format:
[
{timestmap, channel_0, ..., channel_N},
...
{timestmap, channel_0, ..., channel_N}
]



- Cloudbrain style guide
- 4 space indents
- 120 characters per line max
- Interface lives in __init__.py of package
- package names should all be lower case
- prefer 1 class per package


TODO
- create a stdout publisher
- remove one of the two publish methods for the publisher?
Empty file added cloudbrain/__init__.py
Empty file.
38 changes: 38 additions & 0 deletions cloudbrain/conf/hackthebrain_modules_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"modules": [
{
"name": "OpenBCISource",
"package": "cloudbrain.modules.sources.openbci",
"options": {
"port": "/dev/tty.OpenBCI-DN0095VT",
"baud": 115200,
"filter_data": true
},
"publishers": [
{
"name": "PikaPublisher",
"package": "cloudbrain.publishers.rabbitmq",
"options": {
"rabbitmq_address": "localhost",
"rabbitmq_user": "guest",
"rabbitmq_pwd": "guest"
},
"base_routing_key": "amsterdam:openbci",
"metrics": [
{
"metric_name": "eeg",
"num_channels": 8,
"buffer_size": 2
},
{
"metric_name": "alpha",
"num_channels": 8,
"buffer_size": 2
}
]
}
],
"subscribers": []
}
]
}
78 changes: 78 additions & 0 deletions cloudbrain/conf/modules_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"modules": [
{
"name": "OpenBCISource",
"package": "cloudbrain.modules.sources.openbci",
"options": {
"port": "/dev/tty.OpenBCI-DN0095VT",
"baud": 115200,
"filter_data": true
},
"publishers": [
{
"name": "PikaPublisher",
"package": "cloudbrain.publishers.rabbitmq",
"options": {
"rabbitmq_address": "rabbitmq.cloudbrain.rocks",
"rabbitmq_user": "cloudbrain",
"rabbitmq_pwd": "cloudbrain"
},
"base_routing_key": "amsterdam:openbci",
"metrics": [
{
"metric_name": "eeg",
"num_channels": 8,
"buffer_size": 2
},
{
"metric_name": "alpha",
"num_channels": 8,
"buffer_size": 2
}
]
},
{
"name": "PikaPublisher",
"package": "cloudbrain.publishers.rabbitmq",
"options": {
"rabbitmq_address": "localhost",
"rabbitmq_user": "guest",
"rabbitmq_pwd": "guest"
},
"base_routing_key": "amsterdam:openbci",
"metrics": [
{
"metric_name": "eeg",
"num_channels": 8,
"buffer_size": 2
},
{
"metric_name": "alpha",
"num_channels": 8,
"buffer_size": 2
}
]
},
{
"name": "StdoutPublisher",
"package": "cloudbrain.publishers.stdout",
"options": {},
"base_routing_key": "amsterdam:openbci",
"metrics": [
{
"metric_name": "eeg",
"num_channels": 8,
"buffer_size": 2
},
{
"metric_name": "alpha",
"num_channels": 8,
"buffer_size": 2
}
]
}
],
"subscribers": []
}
]
}
163 changes: 163 additions & 0 deletions cloudbrain/conf/supported_devices.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# RabbitMQ info
ROUTING_KEY = "%s:%s:%s"
RMQ_USER = 'guest'
RMQ_PWD = 'guest'

# Database info
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
SENSOR_DATA_KEYSPACE = "sensor_data"
ANALYTICS_KEYSPACE = "analytics"
USERS_KEYSPACE = "users"
USERS_CONSENT_TABLE = "users_consent"
TAGS_TABLE_NAME = "tags"
AGGREGATES_TABLE_NAME = "aggregates"

# Servers addresses
CASSANDRA_ADDRESS = '127.0.0.1',
RABBITMQ_ADDRESS = '127.0.0.1'
WEBSERVER_ADDRESS = '127.0.0.1'
WEBSERVER_PORT = 8080

# Metadata of wearable devices supported by CloudBrain.
DEVICE_METADATA = [
{'device_name': 'openbci',
'device_type': 'eeg_headset',
'metrics':
[
{
'metric_name': 'eeg',
'num_channels': 8,
'metric_description': 'Raw eeg data coming from the OpenBCI channels'
}
]
},
{
'device_name': 'muse',
'device_type': 'eeg_headset',
'metrics':
[
{
'metric_name': 'eeg',
'num_channels': 4,
'metric_description': 'Raw eeg data coming from the 4 channels of the Muse'
},
{
'metric_name': 'horseshoe',
'num_channels': 4,
'metric_description': 'Status indicator for each channel (1 = good, 2 = ok, >=3 bad)'
},
{
'metric_name': 'concentration',
'num_channels': 1,
'metric_description': None
},
{
'metric_name': 'mellow',
'num_channels': 1,
'metric_description': None
},
{
'metric_name': 'acc',
'num_channels': 3,
'metric_description': None
},
{
'metric_name': 'delta_absolute',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'theta_absolute',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'beta_absolute',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'alpha_absolute',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'gamma_absolute',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'delta_relative',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'theta_relative',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'beta_relative',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'alpha_relative',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'gamma_relative',
'num_channels': 4,
'metric_description': None
},
{
'metric_name': 'is_good',
'num_channels': 4,
'metric_description': 'Strict data quality indicator for each channel, 0= bad, 1 = good.'
},
{
'metric_name': 'blink',
'num_channels': 1,
'metric_description': None
},
{
'metric_name': 'jaw_clench',
'num_channels': 1,
'metric_description': None
},

]
},
{
'device_name': 'neurosky',
'device_type': 'eeg_headset',
'metrics': [
{
'metric_name': 'eeg',
'num_channels': 1,
'metric_description': None
},
{
'metric_name': 'attention',
'num_channels': 1,
'metric_description': None
},
{
'metric_name': 'meditation',
'num_channels': 1,
'metric_description': None
},
{
'metric_name': 'fft',
'num_channels': 8,
'metric_description': None
},
{
'metric_name': 'signal_strength',
'num_channels': 1,
'metric_description': None
},
]
}
]
Empty file.
Loading

0 comments on commit 92242f9

Please sign in to comment.