Skip to content

Commit

Permalink
Copy slow synthetic data streams to aux board (#556)
Browse files Browse the repository at this point in the history
* add more data to aux preset for synthetic board
  • Loading branch information
philippitts committed Oct 4, 2022
1 parent e37ba4c commit 7f32586
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/board_controller/brainflow_boards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,17 @@ BrainFlowBoards::BrainFlowBoards()
{"name", "SyntheticAux"},
{"sampling_rate", 250},
{"package_num_channel", 0},
{"timestamp_channel", 5},
{"marker_channel", 6},
{"num_rows", 7},
{"other_channels", {1, 2, 3, 4}}
{"timestamp_channel", 18},
{"marker_channel", 19},
{"num_rows", 20},
{"other_channels", {14, 15, 16, 17}},
{"battery_channel", 1},
{"accel_channels", {2, 3, 4}},
{"gyro_channels", {5, 6, 7}},
{"eda_channels", {8}},
{"ppg_channels", {9, 10}},
{"temperature_channels", {11}},
{"resistance_channels", {12, 13}}
};
brainflow_boards_json["boards"]["-1"]["default"] =
{
Expand Down
36 changes: 36 additions & 0 deletions src/board_controller/synthetic_board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,42 @@ void SyntheticBoard::read_thread ()
aux_package[board_descr["auxiliary"]["timestamp_channel"].get<int> ()] =
timestamp + num_in_batch / (double)sampling_rate;
package[board_descr["auxiliary"]["package_num_channel"].get<int> ()] = (double)counter;
package[board_descr["auxiliary"]["battery_channel"].get<int> ()] =
(dist_around_one (mt) - 0.1) * 100;
for (int channel : board_descr["auxiliary"]["accel_channels"])
{
package[channel] = dist_around_one (mt) - 0.1;
}
for (int channel : board_descr["auxiliary"]["gyro_channels"])
{
package[channel] = dist_around_one (mt) - 0.1;
}
for (int channel : board_descr["auxiliary"]["eda_channels"])
{
package[channel] = dist_around_one (mt);
}
for (int chan_num = 0; chan_num < (int)board_descr["auxiliary"]["ppg_channels"].size ();
chan_num++)
{
int channel = board_descr["auxiliary"]["ppg_channels"][chan_num];
if (chan_num == 0)
{
package[channel] = 500.0 * dist_around_one (mt);
}
else
{
package[channel] = 253500.0 * dist_around_one (mt);
}
}
for (int channel : board_descr["auxiliary"]["temperature_channels"])
{
package[channel] = dist_around_one (mt) / 10.0 + 36.5;
}
for (int channel : board_descr["auxiliary"]["resistance_channels"])
{
package[channel] = 1000.0 * dist_around_one (mt);
}

push_package (aux_package, (int)BrainFlowPresets::AUXILIARY_PRESET);

counter++;
Expand Down

0 comments on commit 7f32586

Please sign in to comment.