## 1 Introduction  
Robotic exoskeletons are wearable devices that can enhance physical performance and provide movement assistance. In the case of lower-limb robotic exoskeletons, they can be beneficial for people with motor impairment in the lower extremities as they can assist the gait and facilitate rehabilitation [1]. The combination of lower-limb robotic exoskeletons with brain-machine interfaces (BMI), which are systems that decode neural activity to drive output devices, offers a new method to provide motor support. Thus, patients could walk while being assisted by an exoskeleton that is controlled by their brain activity. In the literature, there are different BMI control paradigms for lower-limb exoskeletons based on brain changes. The most common ones are steady-state visually evoked potentials [2], which are based on visual stimuli; motion-related cortical potentials [3; 4; 5; 6], which are produced between 1500 and 500 ms before the execution of the movement, and and event-related desynchronization/synchronization (ERD/ERS), which is considered to indicate the activation and posterior recovery of the motor cortex during preparation and completion of a movement [7; 8; 9]. BMI based on ERD/ERS are usually employed to detect motion intention [3; 6; 10]. Similar ERD/ERS patterns are produced during motor imagery (MI), which consists of the imagination of a movement [11; 12; 13]. When performing MI, in contrast to external stimuli, brain changes are induced voluntarily and internally by the subject. BMI based on MI have the objective of identifying different MI tasks or differentiating between MI and an idle state [5; 14; 15; 16]. The work of [16] combined MI with eye blinks as a control criterion. The main limitation of MI is that patients have to maintain it for long periods in order to force the external device to perform any action. However, contrary to instantaneous brain changes, such as MRCP or motion intention, continuous cognitive involvement of a patient during the assisted motion can induce mechanisms of neuroplasticity. Neuoplasticty is the ability of the brain to reorganize its structure and promote rehabilitation [17]. The performance of maintained brain tasks can be challenging as it requires high focus from the user during the whole experiment and any external influence could easily disturb it. Previous studies have tried to evaluate the level of attention of a subject during the control of the external device [18] and some of them have considered it as a control paradigm for a lower-limb BMI [15]. BMI systems need a training phase in which the model is calibrated for each subject and then it is tested with with new data. In [5; 14; 15; 16], during the training phase, participants alternated periods of MI with idle state and the output device was only moving during MI. Nevertheless, since BMI focus on sensorimotor rhythms, it is difficult to ensure that it is not considering the actual motion instead of motor imagery. In our previous work [19], we designed a lower-limb MI BMI to control a treadmill and it was tested with able-bodied subjects. The BMI combined the paradigm of MI with another one that measured the level of attention that users had during MI tasks. In the test phase, i.e., when the output device was commanded by the BMI, the treadmill was only activated when the attention measured was higher than a certain threshold, reducing the number of false triggers. In order to ensure that motion artifacts did not affect the BMI classifier model, the training phase consisted of two types of trials: full standing and full motion trials. The mental tasks to perform were the same for both types, alternating periods of MI with idle state. Both types of trials allowed the creation of two different classifier models to be applied depending on the status of the subject: gait and stand. In this study, the BMI designed in [19] was adapted for the control of the gait of a lower-limb exoskeleton and it was evaluated with able-bodied subjects.