Calibrating Your Odometry Sensor
Software Setup
Arduino
We've written a library to get you started with the SparkFun Optical Tracking Odometry Sensor. You can obtain this library through the Arduino Library Manager by searching for "SparkFun Qwiic OTOS Arduino Library" and installing the latest version from SparkFun. If you prefer downloading libraries manually, you can grab them from the GitHub Repository.
Python
In addition to the library provided above, we have written a Python script that allows you to visualize an XRP in real time. Download via the button below.
Linux/Raspberry Pi Variants
We've written a python package to get you started with the SparkFun Optical Tracking Odometry Sensor. It's been included in the SparkFun Qwiic Python package, which aggregates all Python Qwiic drivers/modules to provide a single entity for Qwiic within a Python environment. The Qwiic_Py GitHub Library ReadMe has more information on the Qwiic Python package.
If you already have your Qwiic Python package installed, you can update it with the following command:
pip install --upgrade sparkfun-qwiic
If you don't have the Qwiic Python package installed already, you can install it with the following command:
pip install sparkfun-qwiic
If you prefer to install just this package, use the following command:
pip install sparkfun-qwiic-otos
If you prefer downloading the code to build and install the package manually, you can grab them from the GitHub Repository.
If you are working with a Raspberry Pi and are using the new Bookworm distribution of the Raspberry Pi OS, refer to these instructions to setup a virtual environment.
Make sure to include the --system-site-packages flag:python3 -m venv --system-site-packages
Then it is possible to install the packages using pip.
XRP/MicroControllers
If you are working with the XRP or other microcontroller, pip will not work for you. Instead, you'll need to install the Qwiic_I2C_Py driver as well as the Qwiic_OTOS driver.
Install Qwiic_OTOS_Py
Qwiic_I2C_Py is a generic I2C driver we have created to work on various platforms (such as MicroPython). Our Qwiic Python device drivers take advantage of Qwiic_I2C_Py to function correctly on any of the supported platforms, so it is a required dependency to use our OTOS Python driver.
Fist, go to the Qwiic_I2C_Py repository and download it as a .zip file. Once downloaded, extract the qwiic_i2c
folder within.
Connect your XRP to your computer over USB, navigate to the XRPCode IDE, and connect to your XRP. For usage information, see the XRPCode User Guide.
Create a new folder within the lib
directory (right-click on the folder), and name it qwiic_i2c
.
lib
directory qwiic_i2c
Upload the files from the previously extracted qwiic_i2c
folder into the new folder you just created on the XRP. From the File menu, choose the Upload to XRP option:
Then select the extracted files:
Then choose the newly created qwiic_i2c
folder on the XRP:
qwiic_i2c
folder Uploading...
You can test to confirm correct installation by typing import qwiic_i2c
followed by qwiic_i2c.get_i2c_driver().scan()
in the Shell. If no errors are printed, then the Qwiic_I2C_Py driver has been installed correctly!
Install Qwiic_OTOS_Py
Fist, go to the Qwiic_OTOS_Py repository and download just the qwiic_otos.py
file.
Connect your XRP to your computer over USB, navigate to the XRPCode editor, and connect to your XRP. For usage information, see the XRPCode User Guide.
Upload the qwiic_otos.py
file into the lib
folder on the XRP. From the File menu, choose the Upload to XRP option:
Select the qwiic_otos.py file:
Then select the lib folder on the XRP:
lib
folder on the XRP Updating...
You can test to confirm correct installation by typing import qwiic_otos
followed by qwiic_otos.QwiicOTOS().is_connected()
in the Shell. If no errors are printed, then the Qwiic_OTOS_Py driver has been installed correctly!
Testing the install:
Visualization
In addition to the package provided here, we have written a Python script that allows you to visualize the XRP in real time. Download via the button below.