-
-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates on adding Synchroni Devices #754
base: master
Are you sure you want to change the base?
Changes from 40 commits
ec6a2ca
57fc0ff
a02013d
0603f58
786de8a
8535f3b
db31e3e
e7f491b
e57de14
4101311
3f2d800
fb080bd
a3bbe08
df382a8
db9f21b
d44f2d1
03fbcdf
ffd34dc
cd3b491
522da1c
82877ac
2e1d9f9
4e77a44
92e0d58
fb940f7
81aacfc
5d42765
fcaf827
46fdcf5
73e1841
45d79ef
e37ecf3
ca855a2
b2f3c01
283d9ee
0da143b
055c439
f5216c8
ec33752
24c0ce0
9db0634
c9f2edc
a0d9d64
3b4bead
3f84870
31514f6
314a68c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -379,4 +379,6 @@ Makefile | |
CMakeSettings.json | ||
._.gitignore | ||
|
||
build/ | ||
build/ | ||
*.DS_Store | ||
/tryinstall/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
cmake_minimum_required (VERSION 3.13) | ||
if (APPLE) | ||
cmake_minimum_required (VERSION 3.28) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is it changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because MAC version requires XCFramework (new format of library), so it will require latest version of CMake |
||
else (APPLE) | ||
cmake_minimum_required (VERSION 3.16) | ||
endif (APPLE) | ||
|
||
project (brainflow) | ||
|
||
SET (CMAKE_CXX_STANDARD 11) | ||
|
@@ -20,6 +25,7 @@ option (USE_LIBFTDI "USE_LIBFTDI" OFF) | |
option (USE_OPENMP "USE_OPENMP" OFF) | ||
option (WARNINGS_AS_ERRORS "WARNINGS_AS_ERRORS" OFF) | ||
option (BUILD_OYMOTION_SDK "BUILD_OYMOTION_SDK" OFF) | ||
option (BUILD_SYNCHRONI_SDK "BUILD_SYNCHRONI_SDK" ON) | ||
option (BUILD_BLUETOOTH "BUILD_BLUETOOTH" OFF) | ||
option (BUILD_BLE "BUILD_BLE" OFF) | ||
option (BUILD_ONNX "BUILD_ONNX" OFF) | ||
|
@@ -72,4 +78,4 @@ install ( | |
EXPORT ${TARGETS_EXPORT_NAME} | ||
NAMESPACE brainflow:: | ||
DESTINATION ${CONFIG_INSTALL_DIR} | ||
) | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,12 @@ public enum BoardIds | |
EXPLORE_PLUS_8_CHAN_BOARD(54), | ||
EXPLORE_PLUS_32_CHAN_BOARD(55), | ||
PIEEG_BOARD(56), | ||
NEUROPAWN_KNIGHT_BOARD(57); | ||
NEUROPAWN_KNIGHT_BOARD(57), | ||
SYNCHRONI_TRIO_3_CHANNELS_BOARD(58), | ||
SYNCHRONI_OCTO_8_CHANNELS_BOARD(59), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 60 is missed, such ids should match each other among languages otherwise it will not work There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed id in new commit |
||
SYNCHRONI_PENTO_8_CHANNELS_BOARD(61), | ||
SYNCHRONI_UNO_1_CHANNELS_BOARD(62); | ||
|
||
|
||
private final int board_id; | ||
private static final Map<Integer, BoardIds> bi_map = new HashMap<Integer, BoardIds> (); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,14 @@ export BrainFlowInputParams | |
EXPLORE_PLUS_8_CHAN_BOARD = 54 | ||
EXPLORE_PLUS_32_CHAN_BOARD = 55 | ||
PIEEG_BOARD = 56 | ||
|
||
NEUROPAWN_KNIGHT_BOARD = 57 | ||
SYNCHRONI_TRIO_3_CHANNELS_BOARD = 58 | ||
SYNCHRONI_OCTO_8_CHANNELS_BOARD = 59 | ||
SYNCHRONI_PENTO_8_CHANNELS_BOARD = 62 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 60 and 61 are missed, see no reasons for such gaps, so please change board ids There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed ID in new commit |
||
SYNCHRONI_UNO_1_CHANNELS_BOARD = 63 | ||
|
||
|
||
|
||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,13 @@ | |
EXPLORE_PLUS_8_CHAN_BOARD(54) | ||
EXPLORE_PLUS_32_CHAN_BOARD(55) | ||
PIEEG_BOARD(56) | ||
|
||
NEUROPAWN_KNIGHT_BOARD(57) | ||
SYNCHRONI_TRIO_3_CHANNELS_BOARD(58) | ||
SYNCHRONI_OCTO_8_CHANNELS_BOARD(59) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 60 is missed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed ID in new commit |
||
SYNCHRONI_PENTO_8_CHANNELS_BOARD(61) | ||
SYNCHRONI_UNO_1_CHANNELS_BOARD(62) | ||
|
||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,9 +69,14 @@ export enum BoardIds { | |
EXPLORE_PLUS_8_CHAN_BOARD = 54, | ||
EXPLORE_PLUS_32_CHAN_BOARD = 55, | ||
PIEEG_BOARD = 56, | ||
NEUROPAWN_KNIGHT_BOARD = 57 | ||
} | ||
|
||
NEUROPAWN_KNIGHT_BOARD = 57, | ||
SYNCHRONI_TRIO_3_CHANNELS_BOARD = 58, | ||
SYNCHRONI_OCTO_CHANNELS_BOARD = 59, | ||
SYNCHRONI_PENTO_8_CHANNELS_BOARD = 61, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 60 is missed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed id in new commit |
||
SYNCHRONI_UNO_1_CHANNELS_BOARD = 62 | ||
|
||
} | ||
export enum IpProtocolTypes { | ||
NO_IP_PROTOCOL = 0, | ||
UDP = 1, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,7 +85,9 @@ def main(): | |
params.mac_address = args.mac_address | ||
|
||
try: | ||
board_shim = BoardShim(BoardIds.ENOPHONE_BOARD, params) | ||
# board_shim = BoardShim(BoardIds.ENOPHONE_BOARD, params) | ||
# board_shim = BoardShim(BoardIds.SYNCHRONI_8_CHANNELS_BOARD, params) | ||
board_shim = BoardShim(BoardIds.SYNCHRONI_3_CHANNELS_BOARD, params) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do not change example from other boards There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed back to enophone |
||
board_shim.prepare_session() | ||
board_shim.start_stream(450000, '') | ||
Graph(board_shim) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import time | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file should not be here and why is it copypasted? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. file deleted, seems to be accidentally copy pasted, sorry about that |
||
|
||
from brainflow.board_shim import BoardShim, BrainFlowInputParams, LogLevels, BoardIds | ||
from brainflow.data_filter import DataFilter, AggOperations | ||
|
||
|
||
def main(): | ||
BoardShim.enable_dev_board_logger() | ||
|
||
# use synthetic board for demo | ||
params = BrainFlowInputParams() | ||
params.mac_address = '84:BA:20:6E:3C:1E'#'60:77:71:74:E6:B7'# | ||
params.timeout = 40 # board = BoardShim(BoardIds.SYNTHETIC_BOARD.value, params) | ||
board = BoardShim(59, params) | ||
board.prepare_session() | ||
board.start_stream() | ||
BoardShim.log_message(LogLevels.LEVEL_INFO.value, 'start sleeping in the main thread') | ||
time.sleep(10) | ||
data = board.get_board_data(20) | ||
print(data) | ||
board.stop_stream() | ||
board.release_session() | ||
|
||
# eeg_channels = BoardShim.get_eeg_channels(BoardIds.SYNTHETIC_BOARD.value) | ||
eeg_channels = BoardShim.get_eeg_channels(59) | ||
# demo for downsampling, it just aggregates data | ||
for count, channel in enumerate(eeg_channels): | ||
print('Original data for channel %d:' % channel) | ||
print(data[channel]) | ||
if count == 0: | ||
downsampled_data = DataFilter.perform_downsampling(data[channel], 3, AggOperations.MEDIAN.value) | ||
elif count == 1: | ||
downsampled_data = DataFilter.perform_downsampling(data[channel], 2, AggOperations.MEAN.value) | ||
else: | ||
downsampled_data = DataFilter.perform_downsampling(data[channel], 2, AggOperations.EACH.value) | ||
print('Downsampled data for channel %d:' % channel) | ||
print(downsampled_data) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,14 @@ | |
from brainflow.data_filter import DataFilter, FilterTypes, WindowOperations, DetrendOperations | ||
from pyqtgraph.Qt import QtGui, QtCore | ||
|
||
#python d:\workspace\brainflow\python_package\examples\plot_real_time\plot_real_time.py --board-id=57 --mac-address=C4:64:E3:D8:E6:C6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is it? revert it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reverted file |
||
|
||
#python d:\workspace\brainflow\python_package\examples\plot_real_time\plot_real_time.py --board-id=57 --mac-address=C4:64:E3:D8:E4:8D | ||
|
||
#python d:\workspace\brainflow\python_package\examples\plot_real_time\plot_real_time.py --board-id=58 --mac-address=60:77:71:74:E6:B7 | ||
|
||
#python d:\workspace\brainflow\python_package\examples\plot_real_time\plot_real_time.py --board-id=59 --mac-address=00:3C:84:22:30:F5 | ||
|
||
class Graph: | ||
def __init__(self, board_shim): | ||
pg.setConfigOption('background', 'w') | ||
|
@@ -36,7 +43,7 @@ def __init__(self, board_shim): | |
def _init_pens(self): | ||
self.pens = list() | ||
self.brushes = list() | ||
colors = ['#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F'] | ||
colors = ['#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F','#A54E4E', '#A473B6', '#5B45A4', '#2079D2', '#32B798', '#2FA537', '#9DA52F', '#A57E2F', '#A53B2F'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this also not needed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reverted file |
||
for i in range(len(colors)): | ||
pen = pg.mkPen({'color': colors[i], 'width': 2}) | ||
self.pens.append(pen) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,17 +37,22 @@ def main(): | |
params.timeout = args.timeout | ||
params.file = args.file | ||
params.master_board = args.master_board | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this file should not be changed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes removed |
||
board = BoardShim(args.board_id, params) | ||
|
||
board.prepare_session() | ||
board.start_stream () | ||
time.sleep(10) | ||
# data = board.get_current_board_data (256) # get latest 256 packages or less, doesnt remove them from internal buffer | ||
|
||
time.sleep(0) | ||
print("The following is data") | ||
#data = board.get_current_board_data (256) # get latest 256 packages or less, doesnt remove them from internal buffer | ||
data = board.get_board_data() # get all data and remove it from internal buffer | ||
|
||
print(data) | ||
board.stop_stream() | ||
board.release_session() | ||
|
||
print(data) | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,13 @@ BrainFlowBoards::BrainFlowBoards() | |
{"54", json::object()}, | ||
{"55", json::object()}, | ||
{"56", json::object()}, | ||
{"57", json::object()} | ||
{"57", json::object()}, | ||
{"58", json::object()}, | ||
{"59", json::object()}, | ||
{"60", json::object()}, | ||
{"61", json::object()}, | ||
{"62", json::object()} | ||
|
||
} | ||
}}; | ||
|
||
|
@@ -1107,6 +1113,53 @@ BrainFlowBoards::BrainFlowBoards() | |
{"eeg_channels", {1, 2, 3, 4, 5, 6, 7, 8}}, | ||
{"other_channels", {9, 10}} | ||
}; | ||
brainflow_boards_json["boards"]["58"]["default"] = { | ||
{"name", "Sync-Trio"}, | ||
{"sampling_rate", 250}, | ||
{"package_num_channel", 0}, | ||
{"timestamp_channel", 4}, | ||
{"marker_channel", 5}, | ||
{"num_rows", 6}, | ||
{"eeg_channels", {1, 2}}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it really ecg channel only? for the cases where electrode can be connected to everything and there is no way to know it in front we just write eeg_channels emg_channels and ecg_channels to the same values(e.g. openbci ganglion) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We recommend user use according to IFU |
||
{"ecg_channels", {3}} | ||
}; | ||
brainflow_boards_json["boards"]["59"]["default"] = { | ||
{"name", "Sync-Octo"}, | ||
{"sampling_rate", 250}, | ||
{"package_num_channel", 0}, | ||
{"timestamp_channel", 9}, | ||
{"marker_channel", 10}, | ||
{"num_rows", 11}, | ||
{"eeg_channels", {1, 2, 3, 4, 5, 6, 7}}, | ||
{"ecg_channels", {8}} | ||
}; | ||
brainflow_boards_json["boards"]["60"]["default"] = { | ||
{"name", "OB5000MAX"}, | ||
{"sampling_rate", 250}, | ||
{"package_num_channel", 0}, | ||
{"timestamp_channel", 9}, | ||
{"marker_channel", 10}, | ||
{"num_rows", 11}, | ||
{"eeg_channels", {1, 2, 3, 4, 5, 6, 7, 8}}, | ||
}; | ||
brainflow_boards_json["boards"]["61"]["default"] = { | ||
{"name", "Sync-Neo"}, | ||
{"sampling_rate", 250}, | ||
{"package_num_channel", 0}, | ||
{"timestamp_channel", 9}, | ||
{"marker_channel", 10}, | ||
{"num_rows", 11}, | ||
{"eeg_channels", {1, 2, 3, 4, 5, 6, 7, 8}} | ||
}; | ||
brainflow_boards_json["boards"]["62"]["default"] = { | ||
{"name", "Sync-Uno"}, | ||
{"sampling_rate", 250}, | ||
{"package_num_channel", 0}, | ||
{"timestamp_channel", 2}, | ||
{"marker_channel", 3}, | ||
{"num_rows", 4}, | ||
{"eeg_channels", {1}} | ||
}; | ||
} | ||
|
||
BrainFlowBoards boards_struct; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed and discarding changes resulted from changes in gitignore