Skip to main content
. 2024 Jan 31;24(3):918. doi: 10.3390/s24030918
Algorithm 1 EEG overriding algorithm
  • 1:

    1. Initialize System:

  • 2:

    a. Start the EEG-based decision-making module.

  • 3:

    b. Start the obstacle avoidance module using computer vision.

  • 4:

    c. Set system parameters, including EEG accuracy threshold and obstacle detection thresholds.

  • 5:

    d. Read EEG signals and wait for the EEG-based decision-making modules buffers to fill.

  • 6:

    2. Loop:

  • 7:

    a. Read EEG signals and determine the user’s intended action (left, right, forward).

  • 8:

    b. Read RGB images from the onboard camera for obstacle detection.

  • 9:

    3. EEG Decision Processing:

  • 10:

    a. If EEG accuracy >= Probability of object presence:

  • 11:

    i. Proceed with the user’s intended action.

  • 12:

    b. Else:

  • 13:

    i. Pause the EEG-based decision-making temporarily.

  • 14:

    ii. Activate the obstacle avoidance module.

  • 15:

    4. Obstacle Avoidance:

  • 16:

    a. Process the RGB image to obtain an inverted distance map.

  • 17:

    b. Divide the map into left, right, and center sections.

  • 18:

    c. Calculate the mean depth of each section.

  • 19:

    d. If any mean depth exceeds the obstacle detection threshold:

  • 20:

    i. Override the user’s intended action with a “stop” command.

  • 21:

    ii. Implement obstacle avoidance maneuvers.

  • 22:

    5. User Feedback:

  • 23:

    a. Provide feedback to the user about the obstacle detection and avoidance.

  • 24:

    6. Resume EEG-Based Decision-Making:

  • 25:

    a. After a predefined time or obstacle-clearance condition, resume the EEG-based decision-making.

  • 26:

    b. Deactivate the obstacle avoidance module.

  • 27:

    7. End Loop.