Skip to content

Move Release v 1.1.0 branch to main #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 47 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,62 @@
SparkFun Optical Tracking Odometry Sensor Arduino Library
========================================

![SparkFun Optical Tracking Odometry Sensor - PAA5160E1](docs/images/gh-banner-2025-arduino-OTOS.png "SparkFun Optical Tracking Odometry Sensor - PAA5160E1Sensor")

<center><img src="https://cdn.sparkfun.com/assets/parts/2/5/2/0/9/SEN-24904-Optical-Tracking-Odometry-Sensor-Feature_1.jpg" width="600" height="600" alt="SparkFun Optical Tracking Odometry Sensor - PAA5160E1 (Qwiic)"></center>
# SparkFun Optical Tracking Odometry Sensor - PAA5160E1

Arduino Library for the SparkFun Optical Tracking Odometry Sensor - PAA5160E1 Sensor

[*SparkFun Optical Tracking Odometry Sensor [SEN-24904]*](https://www.sparkfun.com/products/24904)
![License](https://img.shields.io/github/license/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library)
![Release](https://img.shields.io/github/v/release/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library)
![Release Date](https://img.shields.io/github/release-date/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library)
![Documentation - build](https://img.shields.io/github/actions/workflow/status/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library/build-deploy-ghpages.yml?label=doc%20build)
![Compile - Test](https://img.shields.io/github/actions/workflow/status/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library/compile-sketch.yml?label=compile%20test)
![GitHub issues](https://img.shields.io/github/issues/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library)

Arduino Library for the SparkFun Optical Tracking Odometry Sensor

Repository Contents
-------------------
The [SparkFun Optical Tracking Odometry Sensor - PAA5160E1 (SEN-24904)](https://www.sparkfun.com/sparkfun-optical-tracking-odometry-sensor-paa5160e1-qwiic.html) empowers you to elevate your robot's navigation capabilities with exceptional precision and streamlined integration. This compact, all-in-one sensor leverages the power of the PAA5160E1 chip from PixArt Imaging Inc., delivering accurate dual-axis motion data across various hard floor surfaces. But that's not all! This sensor boasts a powerful built-in 6-axis Inertial Measurement Unit (IMU) and an onboard microcontroller that performs real-time sensor fusion and tracking algorithms.

* **/documents** - Data sheets, additional product information
* **/examples** - Example code
* **/src** - Source code
Looking for the board that matches this library - pick up a [SparkFun Optical Tracking Odometry Sensor - PAA5160E1 (SEN-24904)](https://www.sparkfun.com/sparkfun-optical-tracking-odometry-sensor-paa5160e1-qwiic.html) at www.sparkfun.com.

Documentation
--------------
* **[GitHub Repo](https://github.com/sparkfun/SparkFun_Optical_Tracking_Odometry_Sensor)** - Hardware repository for the SparkFun Optical Tracking Odometry Sensor
* **[Hookup Guide](https://docs.sparkfun.com/SparkFun_Optical_Tracking_Odometry_Sensor)** - Hookup Guide for the SparkFun Optical Tracking Odometry Sensor
## Functionality

License Information
-------------------
This library provides an interface that enables the following functionality when a SparkFun Optical Tracking Odometry Sensor - PAA5160E1 Sensors:

This product is _**open source**_!
* ***TODO***
*


## General Use

***TODO***

## Examples

The following examples are provided with the library

- [Basic Readings](examples/Example1_BasicReadings/Example1_BasicReadings.ino) - This example demonstrates how to read the position and heading from the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS).
- [Set Units](examples/Example2_SetUnits/Example2_SetUnits.ino) - This example demonstrates how to change the units of the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS)..
- [Calibration](examples/Example3_Calibration/Example3_Calibration.ino) - This example demonstrates how to calibrate the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS)..
- [Set Offset and Position](examples/Example4_SetOffsetAndPosition/Example4_SetOffsetAndPosition.ino) - This example demonstrates how to set the offset and position of the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS).
-[Velocity and Acceleration](examples/Example5_VelocityAndAcceleration/Example5_VelocityAndAcceleration.ino) - This example demonstrates how to read the velocity and acceleration from the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS).
- [Standard Deviation](examples/Example6_StandardDeviation/Example6_StandardDeviation.ino) - This example demonstrates how to read the standard deviation of the measurements of the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS).
- [Get Version](examples/Example7_GetVersion/Example7_GetVersion.ino) - This example demonstrates how to get the hardware and firmware version numbers from the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS).
- [Self Test](examples/Example8_SelfTest/Example8_SelfTest.ino) - This example demonstrates how to perform a self test of the SparkFun Qwiic Optical Tracking Odometry Sensor (OTOS).

## Documentation

The full API and use documentation for this library is provided [here](https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/). For a quick reference, the main methods available in the library are listed [here](https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s.html).

Curious about the hardware this board works with - visit the SparkFun Optical Tracking Odometry Sensor [hardware repository](https://github.com/sparkfun/SparkFun_Optical_Tracking_Odometry_Sensor).

The ***Hookup Guide*** for the SparkFun Optical Tracking Odometry Sensor is available [here](https://docs.sparkfun.com/SparkFun_Optical_Tracking_Odometry_Sensor).

## License Information

This product is ***open source***!

This product is licensed using the [MIT Open Source License](https://opensource.org/license/mit).

Please review the LICENSE.md file for license information.

If you have any questions or concerns on licensing, please contact technical support on our [SparkFun forums](https://forum.sparkfun.com/viewforum.php?f=152).

Distributed as-is; no warranty is given.

- Your friends at SparkFun.

_<COLLABORATION CREDIT>_
2 changes: 1 addition & 1 deletion docs/doxygen/doxygen-config
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ ALWAYS_DETAILED_SEC = YES
# operators of the base classes will not be shown.
# The default value is: NO.

INLINE_INHERITED_MEMB = NO
INLINE_INHERITED_MEMB = YES

# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
# before files name in the file list and in the header files. If set to NO the
Expand Down
Binary file added docs/images/gh-banner-2025-arduino-OTOS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions examples/Example8_SelfTest/Example8_SelfTest.ino
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
SPDX-License-Identifier: MIT

Copyright (c) 2024 SparkFun Electronics
*/

Expand Down Expand Up @@ -41,10 +41,10 @@ void setup()
Serial.println("The OTOS must be stationary during the self test!");

// Perform the self test
sfeTkError_t result = myOtos.selfTest();
sfTkError_t result = myOtos.selfTest();

// Check if the self test passed
if(result == kSTkErrOk)
if (result == ksfTkErrOk)
{
Serial.println("Self test passed!");
}
Expand Down
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name=SparkFun Qwiic OTOS Arduino Library
version=1.0.2
version=1.1.0
author=SparkFun Electronics <[email protected]>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=A library to use the SparkFun Qwiic Optical Tracking Odometry Sensor
paragraph=
paragraph=The SparkFun Qwiic Optical Tracking Odometry Sensor empowers you to elevate a robots navigation capabilities with precision and streamlined integration.
category=Sensors
url=https://github.com/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library
architectures=*
depends=SparkFun Toolkit (<1.0.0)
depends=SparkFun Toolkit (>=1.0.0)
41 changes: 31 additions & 10 deletions src/SparkFun_Qwiic_OTOS_Arduino_Library.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
/*
SPDX-License-Identifier: MIT

Copyright (c) 2024 SparkFun Electronics
*/
/**
* @file SparkFun_Qwiic_OTOS_Arduino_Library.h
* @brief Arduino wrapper for the SparkFun Qwiic OTOS sensor driver
* @details This file provides an Arduino-compatible interface to the SparkFun Qwiic
* Optical Tracking Odometry Sensor (OTOS). It wraps the platform-agnostic
* C++ driver to provide familiar Arduino conventions and simplified usage.
*
* Features:
* - Simple Arduino-style begin() function
* - Default Wire interface support
* - Compatible with all Arduino platforms
* - Inherits all functionality from base C++ driver
* - Automatic I2C bus configuration
*
* @author SparkFun Electronics
* @date February 2024
* @copyright Copyright (c) 2024-2025, SparkFun Electronics Inc.
*
* SPDX-License-Identifier: MIT
*
* @see https://github.com/sparkfun/SparkFun_Qwiic_OTOS_Arduino_Library
*/

// ...existing code...

/*******************************************************************************
SparkFun_Qwiic_OTOS_Arduino_Library.h - Arduino wrapper of the C++ driver
Expand All @@ -13,14 +32,16 @@
*******************************************************************************/

#pragma once

// clang-format off
#include "Arduino.h"
#include "sfeQwiicOtos.h"
#include <SparkFun_Toolkit.h>
#include "sfTk/sfDevOTOS.h"
#include <Wire.h>
// clang-format on

/// @brief Arduino class for the SparkFun Qwiic Optical Tracking Odometry Sensor
/// (OTOS)
class QwiicOTOS : public sfeQwiicOtos
class QwiicOTOS : public sfDevOTOS
{
public:
/// @brief Begins the Qwiic OTOS and verifies it is connected
Expand All @@ -32,7 +53,7 @@ class QwiicOTOS : public sfeQwiicOtos
_theI2CBus.init(wirePort, kDefaultAddress);

// Begin the sensor
return sfeQwiicOtos::begin(&_theI2CBus) == kSTkErrOk;
return sfDevOTOS::begin(&_theI2CBus) == ksfTkErrOk;
}

protected:
Expand All @@ -42,5 +63,5 @@ class QwiicOTOS : public sfeQwiicOtos
}

private:
sfeTkArdI2C _theI2CBus;
sfTkArdI2C _theI2CBus;
};
Loading