# Visual-Inertial Odometry Positioning¶

Visual Inertial Odometry (VIO) mode does not store any history of the location of the natural features identified in the scene or the historic position estimates of the robot. This makes this mode the most computationally light. The core output of this system is live position estimate which is accurate over short distances but will become less accurate as distance travelled increases.

## Step 1 - Create a Configuration File¶

You are able to change some of the core parameters for the system using a configuration file. Create a new file vio_mode.json in a convenient directory, e.g. ~/slamcore/custom/vio_mode.json.

Edit the file by running this in a terminal window:

$gedit /usr/share/slamcore/custom/vio_mode.json  Edit or paste the following text into the editor: { "Version": "1.0.0", "Base": { "ProfileName": "vio_mode" }, "Position": { "PositioningMode": "ODOMETRY_ONLY", "Frontend": { "NumKeypoints": 100 } } }  The ProfileName parameter can be set to any name that you wish to be displayed on the SLAMcore Visualiser when the configuration file is being used. The positioning mode is controlled by the PositioningMode parameter and can be set to SLAM or ODOMETRY_ONLY. For this step we will set it to ODOMETRY_ONLY as shown above. Save the text file. You can also use the configuration file to set other parameters which will affect the performance of the system. For example, we will use this config file to set the number of features that will be detected on each frame and used to triangulate the position of the sensor. The number of features can be varied by adjusting the NumKeypoints parameter. This can be set between 10 and 500. The higher the number the better the accuracy and robustness of the system but computational resource will also increase. Real-time performance will likely be required for this mode so we recommend setting the number of features to 100. ## Step 2 - Process a Dataset¶ If you wish to try this mode using a live-sensor feed then you can skip this step. You can process any of the datasets that you recorded in the previous tutorials by typing the following in the terminal: $ slamcore_visualiser dataset -u <path to dataset> -c /usr/share/slamcore/custom/vio_mode.json


This will open the SLAMcore Visualiser tool:

Fig. 46 SLAMcore Visualiser Opening Screen

Now click the Start button:

The dataset which will now be processed with live position estimate (6DoF axis) and historical trajectory (yellow line) calculated and displayed.

Fig. 47 Output of visual-inertial odometry

The current estimated position and velocities in the X,Y and Z axis along with an estimate of total distance travelled are also displayed as numbers in the top left hand corner of the screen.

When the dataset has been fully processed, you will see the following message:

Fig. 48 Message when dataset finished processing

## Step 3 - Try the System in Live Mode¶

If no dataset is specified, the system will default to processing the data from the live sensor as long as you have a registered D435i plugged in. Launch the software by running the following in the terminal:

\$ slamcore_visualiser -c /usr/share/slamcore/custom/vio_mode.json


This will open the SLAMcore Visualiser tool:

Fig. 49 SLAMcore Visualiser Opening Screen

Now click the Start button:

The live sensor-feed will now be processed with live position estimate (6DoF axis) and historical trajectory (yellow line) calculated and displayed.

Fig. 50 Output of Visual-Inertial Odometry

The current estimated position and velocities in the X,Y and Z axis along with an estimate of total distance travelled are also displayed as numbers in the top left hand corner of the screen.