training
This method is to control the training of the mental command and facial expression detections. Before you start a training, you should subscribe to the "sys" data stream.
Name | Type | Required | Description |
cortexToken | string | yes | |
session | string | yes | A session id returned by createSession. The training will be for the headset linked to this session. |
detection | string | yes | Must be "mentalCommand" or "facialExpression". |
status | string | yes | Control what this method does, like start the training, or cancel it... Available status depends on which detection you selected. |
action | string | yes | The action you want to train. Available actions depends on which detection you selected. |
To get the available status for a detection, call getDetectionInfo, and check the field controls of the result object. Or you can check this list:
Status | Description |
start | Start a new training for the specified action. |
accept | Accept a successful training and add it to the profile. |
reject | Reject a successful training. It is not added to the profile. |
reset | Cancel the current training. |
erase | Erase all the training data for the specified action. |
To get the available actions for a detection, call getDetectionInfo, and check the field actions of the result object.
However, note that for the facial expression detection, only these actions can be trained: "neutral", "surprise", "frown", "smile", "clench".
The result is an object containing these fields:
Name | Type | Description |
action | string | The action you set in the request. |
status | string | The status you set in the request. |
message | string | A success message. |
Start a mental command training for the action "push".
Request
Response
{
"id": 14,
"jsonrpc": "2.0",
"method": "training",
"params": {
"action": "push",
"cortexToken": "xxx",
"detection": "mentalCommand",
"session": "f3a35fd0-9163-4cc4-ab30-4ed224369f91",
"status": "start"
}
}
{
"id": 14,
"jsonrpc": "2.0",
"result": {
"action": "push",
"message": "Set up training successfully",
"status": "start"
}
}
Accept a successful training for the action "push".
Request
Response
{
"id": 15,
"jsonrpc": "2.0",
"method": "training",
"params": {
"action": "push",
"cortexToken": "xxx",
"detection": "mentalCommand",
"session": "f3a35fd0-9163-4cc4-ab30-4ed224369f91",
"status": "accept"
}
}
{
"id": 15,
"jsonrpc": "2.0",
"result": {
"action": "push",
"message": "Set up training successfully",
"status": "accept"
}
}
Last modified 28d ago