# EXO User Interface for basic framework The EXO User Interface is created for controlling the exoskeleton in a basic framework. The block diagram of EXO UI is shown in fig.1. The EXO-UI receives the information to show the status graph from the ROS-MQTT bridge, sends the commands to EXO motors (through NUC pc) via ROS framework, and gets the commands from the System Integration program via MQTT. ![Block diagram of EXO User Interface](https://i.imgur.com/0IoyO79.jpg) --- ## Getting Started ### Dependencies - [x] ROS Neotic - [x] Mosquitto MQTT - [x] Python version > 3.7 - numpy==1.23.4 - paho_mqtt==1.6.1 - pyfiglet==0.8.post1 - PyQt5==5.15.7 - pyqtgraph==0.13.1 - rospy==1.15.14 - termcolor==2.1.0 - pyyaml==5.3.1 - rospkg==1.4.0 - netifaces==0.10.4 ### Installation 1. Clone the whole file from [GitLab](https://gitlab.com/BRAIN_Lab/biorobotics-private/exobic) to your local computer. ```shell $ git clone https://gitlab.com/BRAIN_Lab/biorobotics-private/exobic.git ``` 2. Install the needed library from the requirements.txt file. ```shell $ cd ExoUI $ pip install -r requirements.txt #or $ pip3 install -r requirements.txt ``` --- ## How It Works ### Launch the file 1. Change the current directory to cloned directory. Additionally, you can activate the environment before run the UI file. The example how to activate the environment in Linux shows below. **optional** ```shell source my_env/bin/activate ``` ```shell cd Exoskeleton/ExoUI ``` > If you have an error like: Error: Address already in use. You should type `sudo systemctl stop mosquitto` in the MQTT broker terminal pane:1 to stop the MQTT broker, and then type `mosquitto -v` again. 2. Open the new terminal and launch the `main.py` to use the EXO UI. ```shell cd Exoskeleton/ExoUI ``` ```shell python3 main.py #or python main.py ``` The main UI or command UI after running `main.py` is shown in below figure. ![atl_text](/Exoskeleton/ExoUI/pics/manual_pics/mainUI.png) --- ### Step-by-Step To control the exoskeleton. 1. Load ROS topic file. 2. Establish the connection (connect to the NUC pc, MQTT broker and the ROS-MQTT bridge) 3. Select the type of control, and then select the profile pattern type (and vice-versa). 4. Adjust the parameters (such as assistance) to control the motor of each joint. 5. Open the data monitoring window by pressing the `Start Monitoring button`. 6. Press the `Start button` to start controlling the exoskeleton. 7. Press the `Stop button` or `Deactivate button` to stop controlling the exoskeleton. 8. If you want to stop to use the EXO UI, please press the `Disconnect button` in CONNECTION section (NUC, MQTT and ROS-MQTT bridge) to stop the whole thread and avoid the freeze file in your computer. > If you want to change the values, like speed or parameters, you must to press the set button. The current value (example in speed, and example in parameters) that will be used to control the exoskeleton is written on the label. The details of each step are described in this [GitLab's link](https://gitlab.com/BRAIN_Lab/biorobotics-private/exobic/-/tree/main/Exoskeleton/ExoUI)