Tutorial Valentijn 2023:12 \\ \\ \\ ====== How to collect data from the Xsens DOT ====== [[public:tutorial:xsens-dot-data-collection:laptop:python|]] ==== Opperation ==== {{ :public:tutorial:screenshot_2023-12-03_132232.png?200|}} As shown in the image on the right (sourced from the [[https://www.xsens.com/hubfs/Downloads/Manuals/Xsens%20DOT%20User%20Manual.pdf |XsensDOT User Manual]]) the Xsens DOT there is a single button located on the front middle orange panel. This button allows you too **turn on the sensor with a single click** and **turn it off by holding it down for a few seconds**. The dot also contains an LED which shows the status of the dot. When running into errors the led can provide helpful information on the status of the device. There are about 13 different states ranging from different colors to different blinking patterns. Each of these is explained in the [[https://www.xsens.com/hubfs/Downloads/Manuals/Xsens%20DOT%20User%20Manual.pdf | Xsens DOT User Manual by Movella]] ==== Charging ==== The DOT's can be charged individually through the micro USB port found at the bottom of each sensor or all together when placed inside their case and by connecting the included micro USB cable to the case. It is **important to manually turn off each of the sensor after charging!**. As they turn on when connected to power but won't turn off automatically after being disconnected! ==== Compatibility ==== The Xsens DOT is compatible with lots of different platforms as can be seen in the table below (sourced from the [[https://www.xsens.com/hubfs/Downloads/Manuals/Xsens%20DOT%20User%20Manual.pdf |XsensDOT User Manual]]) {{:public:tutorial:screenshot_2023-12-03_131027.png?600|}} ==== Quickly start collecting data ==== For active use the easiest way to collect data is using a mobile phone which runs the **Movella DOT app** [[ https://play.google.com/store/apps/details?id=com.xsens.dot.android&hl=en&gl=US&pli=1 | Movella DOT Android app]] [[ https://apps.apple.com/nl/app/movella-dot/id1500356542 | Movella DOT iOS app]] The setup and use has been well documented by Movella in [[https://www.youtube.com/watch?v=K1KLcnatSdc | this youtube video]] ====== Python: Live data collection and processing ====== In this tutorial we will setup python for live data collection and processing in Python. ==== Requirements ==== We assume you have the following: - Python 3.10 on a machine. (This tutorial will only work with version 3.10) - XSense DOT's - Visual studio code (or another editor) ** 1. Checking the python version**. We must double check that the python version that we have installed is the correct version of **3.10** we can do this using python --version This should return an output like this Python 3.10.2 ** 2. Downloading the movella dot SDK** {{ :public:tutorial:screenshot_2024-01-04_163625.png?300|}} You will need to download the **latest stable software - PC** from [[ https://www.movella.com/support/software-documentation?hsCtaTracking=39d661fa-2ea8-4478-955e-01d0d8885f14%7C3ad1c7d6-9c3a-42e9-b424-5b15b9d0924e | this website]] You may need to provide contact details, you will get a download link emailed to your inbox. After unzipping double click to install the **movelladot_pc_sdk_2023.setup.exe** and follow the wizard. Make sure this is correctly installed before moving on! ** 3. Installing the DOT python library** We must install the Python library for the Xsens DOT by navigating in the file explorer to {{ :public:tutorial:screenshot_2024-01-04_164921.png?400|}} "C:\Program Files\Movella" In which you should see a folder called "DOT PC SDK XXXX.X" note down the name of this folder and what the x's are. You need to replace them in the commands below with your own. Make sure that you see 4 files in here, just like in the screenshot right. Next install the package using (replace the X's with your own version that you have downloaded) pip install "C:\Program Files\Movella\DOT PC SDK XXXX.X\SDK Files\Python\x64\movelladot_pc_sdk-2023.6.0-cp310-none-win_amd64.whl" ** 4. install python dependencies ** The movella DOT sdk has a few dependencies. To install these we must navigate into the **examples** directory in a terminal using cd "C:\Program Files\Movella\DOT PC SDK XXXX.X\SDK Files\Examples\python" (replace the X's with your own version that you have downloaded) We can install the dependencies using the requirements.txt by running: pip install -r requirements.txt ** 5. Running the example code ** Next we can try running the example python script ** recieve_data.py** which is located in the Program files > Movella > DOT PC SDK > SDK Files > Examples > python ====== Collect data on a laptop (CSV) ====== ===== WARNINGS! ===== **WARNING** We will be diving into code and modifying parts of your laptop's system. Please only continue if you understand the risks and are confident that you know what you are doing! **BLUETOOTH DEVICES WARNING** We will be modifying the blueooth driver on the laptop, thus you wont be able to use any Bluetooth devices (such as mice, keyboards or headphones) while connecting to the DOT sensors. ===== Installing dependencies and configuring a bluetooth adapter ===== To easily collect data using your laptop we must install the Xsens DOT Server [[https://github.com/xsens/xsens_dot_server| from github]]. The installation process for [[https://github.com/xsens/xsens_dot_server#set-up-on-windows| windows]], [[https://github.com/xsens/xsens_dot_server#set-up-on-macos| macOS]] and [[https://github.com/xsens/xsens_dot_server#set-up-on-raspberry-pi| raspberry pi] is well documented on their [[https://github.com/xsens/xsens_dot_server#set-up-the-environment | github]]. Linux setup might work but is not directly supported, only installation on a Raspberry Pi is. After installing the dependecies and configuring our bluetooth adapter, you must clone the server application repository using the command git clone https://github.com/xsens/xsens_dot_server.git After which we must open the downloaded folder using cd ./xsens_dot_server We can then start the server using node xsensDotServer Now when you go to localhost:8080/ you should be prompted with a page where you can connect to the sensors, start data collection and download the data as a .csv file **Having issues?** Please check the part below on trouble shooting! ===== Resetting Bluetooth adapter for normal use ===== {{ :public:tutorial:screenshot_2023-12-07_004836.png?400|}} We have configured the Bluetooth adapter using Zadig in a way that does not allow us to use normal Bluetooth devices. 1. Using the search bar look for **Device Manager** and open it 2. In the device manager look for **Universal Serial Bus Devices** 3. In here **select your Bluetooth device** 4. While having the Bluetooth device selected **navigate to Action** at the top bar 5. In the action tab click on **Scan for hardware changes** This should usually work, and you should see the page refresh and the device return back as a normal Bluetooth device as shown below {{:public:tutorial:screenshot_2023-12-07_005434.png?200|}} \\ This however may not always work correctly. After trying the above steps twice please try the steps below (at your own risk) 6. Make sure you still have the **Bluetooth serial device selected** as in step 3 7. With the Bluetooth device selected navigate back to the **Action** tab 8. In the action tab select **Update Driver** 9. In the update driver popup select **Search automatically for drivers** (you may need an internet connection for this) {{:public:tutorial:screenshot_2023-12-07_005845.png?200|}} These additional steps should reinstall your default driver for your Bluetooth adapter. Some of these steps have also been documented [[https://github.com/xsens/xsens_dot_server#reinstall-bluetooth-adapter| here]] by the team that created the XSens DOT server ===== Trouble shooting ===== There are a few common issues that you may have. ==== No device found ==== - You may see Error: No compatible USB Bluetooth 4.0 device found! this can be caused because the adapter can't be found by the nodejs application. This can be solved my modifying part of the code to include your bluetooth adapter when searching for adapters connected. How to do this has been well documented [[https://github.com/xsens/xsens_dot_server#add-bluetooth-adapter | here]]