Emotiv Xavier Tools: XavierComposer usage

XavierComposer emulates the behavior of the EmoEngine with an attached Emotiv neuroheadset.  It is intended to be used as a development and testing tool; it makes it easy to send simulated EmoEngine events and request responses to applications using the Emotiv API in a transparent and deterministic way.

XavierComposer allows you to send user-defined EmoStates™ to Emotiv Xavier, XavierEmoKey, or any other application that makes use of the Emotiv API.  Xavier Composer supports two modes of EmoState generation: Interactive mode and EmoScript mode.  In addition to generating EmoStates, XavierComposer can also simulate Emotiv EmoEngine’s handling of profile management and training requests.

SDK users will rely on Xavier Composer to simulate the behavior of Emotiv EmoEngine and Emotiv neuroheadsets.  However, it is a very useful tool for all Emotiv SDK developers, allowing for easy experimentation with the Emotiv API early in the development process, and facilitating manual and automated testing later in the development cycle.

Interactive Mode

Xavier Composer  Interactive mode allows you to define and send specific EmoState values to any application using the Emotiv SDK.  The user interface settings are described below.

  • Player: choose the player number who’s EmoState you wish to define and send.  The player number defaults to 0.  When the player number is changed for the first time, an application connected to XavierComposer  will receive an EE_UserAdded event with the new player number reported as the user ID.
  • Wireless: sets the simulated wireless signal strength.  Note: if the signal strength is set to “Bad” or “No Signal” then XavierComposer™ simulates the behavior of the EmoEngine by setting subsequent EmoState detection values and signal quality values to 0.
  • Contact Quality tab: this tab allows you to adjust the reported contact quality for each sensor on the Emotiv neuroheadset.  When the Contact Quality tab is active, all other EmoState detection values are set to 0.  You can choose between typical sensor signal quality readings by selecting a preset from the General Settings drop-down list box.  If you choose the Custom preset, each sensor value can be controlled individually by clicking on a sensor and then selecting a new CQ Status value in the Sensor Details box.  Note that the two sensors above and behind the ears, correspond to the reference sensors on the Emotiv SDK Neuroheadset, must always report a CQ value of Good and cannot be adjusted.
  • Detection tab: this tab allows you to interactively control EmoState™ detection values and training result values.  When the Detection tab is active, the contact quality values for generated EmoStates will always be set to EEG_CQ_GOOD.
  • EMOSTATE: define the detection settings in an EmoState™ by selecting the particular event type for each detection group in the appropriate drop-down list box.  Set the event’s value in the spin box adjacent to the event name.  You can define your own time value in the Time edit box, or allow XavierComposer™ to set the value automatically by incrementing it by the value of the EmoState Interval spin box after each EmoState™ is sent.  The Performance Metrics Excitement state is unique in that the EmoEngine returns both short-term (for Instantaneous Excitement) and long-term values.  XavierComposer™ simulates the long-term value calculation adequately enough for testing purposes but does not reproduce the exact algorithm used by the Performance Metrics detection suite in EmoEngine™.  Note that the value for the eye detections is binary (Active or Inactive) and that it is automatically reset to be Inactive after an EmoState™ is sent.  If Auto Repeat mode is active, then you can press and hold the Activate button to maintain a particular eye state across multiple time intervals.  Also note that the value for a neutral Cognitiv detection is automatically set to 0.
  • TRAINING RESULTS: specify the desired return value for EmoEngine™ requests generated for the current player by the EE_CognitivSetTrainingControl and IEE_FacialExpressivSetTrainingControl functions. 
  • EMOENGINE LOG:  contents are intended to give developers a clearer picture about how the EmoEngine processes requests generated by various Emotiv API functions.  The log displays three different output types:  Request, Reply, CogResult, and ExpResult.  An API function call that results in a new request to the EmoEngine will cause a Request output line to be displayed in the log.  The multitude of API functions are translated to roughly a dozen different strings intended to allow the Emotiv SDK developer to see that an API function call has been serviced .  These strings include: PROFILE_ADD_USER, PROFILE_CHANGE_USER, PROFILE_REMOVE_USER, PROFILE_LIST_USER, PROFILE_GET_CURRENT_USER, PROFILE_LOAD, PROFILE_SAVE, FACIALEXPRESSIV_GET, FACIALEXPRESSIV_SET, PERFORMANCEMETRIC_GET, PERFORMANCEMETRIC_SET, COGNITIV_SET and COGNITIV_GET.  Because of the comparatively complex API protocol used to facilitate training the Cognitiv algorithms, we display additional detail when we receive training control messages generated by the EE_CognitivSetTrainingControl API function.  These strings are: COGNITIV_START, COGNITIV_ACCEPT, and COGNITIV_REJECT, which correspond to the EE_TrainingControl_t constants exposed to developers in edk.h.  Similar strings are used for the equivalent Expressiv  messages.  All other request types are displayed as API_REQUEST.  The Reply output line displays the error code and is either green or red, depending on whether an error has occurred (i.e. the error code != 0).  The CogResult and ExpResult outputs are used to inform the developer of an asynchronous response sent from the EmoEngine via an EmoState update as the result of an active Cognitiv or Expressiv  training request.
  • START: sends the EmoState™ to a connected application or the Emotiv Xavier.  Note that Insight SDK will display “Cannot Acquire Data” until the first EmoState™ is received from XavierComposer .
  • Auto Reset: check this box to tell XavierComposer ™ to automatically send EmoStates™ at the time interval specified in the EmoState™ Interval spin box.  Use the Start/Stop button to turn the automated send on and off.  You may interact with the EmoState™ controls to dynamically change the EmoState™ values while the automated send is active.  Note: switching between the Contact Quality and Detection tabs in Interactive mode will automatically stop an automated send.

EmoScript Mode

XavierComposer™ EmoScript mode allows you to playback a predefined sequence of EmoState™ values to any application using the EmoEngine.  The user interface settings are described below.  EmoScript files are written in EML (XavierComposer™ Markup Language).  EML syntax details can be found in the EML Language Specification section in  Appendix 1 this document.

  • Player: choose the player number to associate with the generated EmoStates™.
  • File: click the “...” button to select and load an EmoScript file from disk.  If the file loads successfully then the timeline slider bar and Start button will be activated.  If an error occurs, a message box will appear with a description and approximate location in the file.
  • Timeline Slider: move the slider control to see the EmoState™ and signal quality values for any point on the timeline defined by the EmoScript file.
  • Start/Stop button: starts and stops the playback of the EmoState™ values generated by the EmoScript file.
  • Wireless: the wireless signal strength setting is disabled while in EmoScript mode and the wireless signal strength is always set to “Good.”
  • Contact Quality tab: the indicators on the head model correspond to the values defined by the contact_quality tag at specific time code in the EmoScript file.  If no contact_quality tag has been specified then the contact quality values in the generated EmoStates default to CQ_GOOD.
  • Detection tab: this tab allows you to view EmoState detection values and provides interactive control over training result values.  Unlike Real Time Interactive mode, the signal quality and detection values are determined entirely by the contents of the EmoScript file and you can switch between the Signal Quality tab and the Detection tab to view the appropriate data during playback or timeline navigation.
  • EmoState: the values displayed correspond to the EmoState™ values for a particular point in time as defined by the EmoScript file.  Note that these EmoScript values are not interactive and cannot be modified by the user (use the Interactive mode for this instead).
  • Training Results and EmoEngine Log: these controls operate exactly the same as they do in Interactive Mode.  See the Interactive Mode documentation (above) for more details.
Was this article helpful?
0 out of 1 found this helpful
Have more questions? Submit a request


Powered by Zendesk