Skip to content

Cor 6539: update training and set get mental command info example - #248

Open
tungntEmotiv wants to merge 4 commits into
COR-1866from
COR-6539
Open

tungntEmotiv wants to merge 4 commits into
COR-1866from
COR-6539

Conversation

@tungntEmotiv

Copy link
Copy Markdown
Contributor

The PR include:

  • training mental command example which include training for push, drop, left
  • subscribe com data to receive live mental command data
  • set sensitivity

Please help to review. Thanks
Please see the image for proof
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Training waits can falsely report completion by consuming stale or wrong-detection events, and reading trained-profile configuration can fail in MATLAB because it transposes a struct array.

6 open issues
What changed in this PR

Adds mental-command training and configuration to the Octave SDK, with a keyboard-driven example for training actions and displaying live commands.

Changes:

  • Adds public APIs for profile management, training, and mental-command settings.
  • Supports sys training events and com samples with action names and power values.
  • Adds an interactive training example and documents the public API workflow.
File Description
octave/​README.md Documents training, profiles, and live command data.
octave/​internal/​CortexTraining.m Sends training requests, waits for outcomes, and saves accepted training.
octave/​internal/​CortexStreamParser.m Distinguishes shared-session streams and extracts action names.
octave/​internal/​CortexProfile.m Manages profiles and loads detection metadata.
octave/​internal/​CortexMentalCommandConfiguration.m Reads and updates active actions and sensitivities.
octave/​internal/​CortexManager.m Manages the new internal service instances.
octave/​internal/​CortexHeadset.m Collects training events and buffers command samples.
octave/​internal/​CortexDataBuffer.m Stores action names alongside numeric samples.
octave/​internal/​CortexContext.m Tracks profile state, detection metadata, and training events.
octave/​functions/​cortexTraining.m Exposes training operations and optional waiting.
octave/​functions/​cortexSubscribe.m Allows com and sys subscriptions.
octave/​functions/​cortexProfile.m Exposes profile load, save, and unload operations.
octave/​functions/​cortexMentalCommandInfo.m Exposes configuration reads and saved updates.
octave/​functions/​cortexGetData.m Returns mental-command action names as a fourth output.
octave/​functions/​cortexDisconnect.m Attempts profile unloading and clears profile state.
octave/​functions/​cortexConnect.m Initializes public profile-state fields.
octave/​examples/​mentalCommandTraining.m Demonstrates keyboard training, sensitivity settings, and live display.

Review effort: Balanced

if iscell(value)
items = value(:)';
elseif isstruct(value)
items = num2cell(value(:)');
error('CortexTraining:noSysStream', 'Subscribe to the sys stream to wait for training events.');
end

obj.context.trainingEvents = {};
obj.headset.update(0.25);
events = obj.context.trainingEvents;
for index = seen + 1:numel(events)
if ~isempty(regexp(events{index}.event, pattern, 'once'))
value = sensitivity(position);
end
trainedActions{index} = struct('action', name, ...
'active', any(strcmp(active, name)), ...
Comment on lines +39 to +40
result = CortexProfile.makeResult(profileName, '', true, false, true);
return;
Comment thread octave/README.md
cortex = cortexSession(cortex, 'INSIGHT-A1B2C3D4');
[cortex, profile] = cortexProfile(cortex, 'load', 'my-profile'); % creates it when missing
cortex = cortexSubscribe(cortex, {'sys', 'com'});
started = cortexTraining(cortex, 'mentalCommand', 'push', 'start', 'wait', 30);
Base automatically changed from COR-6538 to COR-1866 November 6, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants