Giter Club home page Giter Club logo

paa5160e1_pico_library's Introduction

PAA5160E1 Raspberry Pi Pico RP2040 Library

This library is a refactoring of SparkFun_Qwiic_OTOS_Arduino_Library to make the SparkFun Optical Tracking Odometry Sensor - PAA5160E1 (Qwiic) compatible with the Raspberry Pi Pico RP2040 SDK.

Description

This library was designed to work in I2C with the PAA5160E1. By default the i2c0 and the GP4 and GP5 are used in this project.

Raspberry Pi Pico and PAA5160E1

Raspberry Pi Pico connected using I2C to the PAA5160E1 - Schematic created with Fritzing

Motivation

By not using Arduino but rather the Raspberry Pi Pico SDK, I set out to port the Arduino library from SparkFun.

Project Structure

The project is structured as follows:

Qwiic_OTOS_Library
├── assets
├── CMakeLists.txt
├── include
│   ├── QwiicOtos.h
│   ├── sfeQwiicOtos.h
│   └── utils.h
├── LICENSE
├── README.md
└── src
    ├── sfeQwiicOtos.cpp
    └── utils.cpp

The specification of Raspberry Pi Pico pins used for I2C, with I2C0 being the default, and the ability to set the I2C baud rate, are defined in utils.h:

Qwiic_OTOS_Library
└── include
    └── utils.h

Requirements

Installation

To use this library, clone the repository into your Raspberry Pi Pico RP2040 project directory:

git clone https://github.com/robotcopper/PAA5160E1_Pico_Library.git

Then include it in your project's CMakeLists.txt file:

add_subdirectory(
	Qwiic_OTOS_Library
)

target_link_libraries(main
    Qwiic_OTOS_Library
)

Usage

Here's a simple example demonstrating how to use the library to initialize the sensor and read odom data:

#include "QwiicOtos.h"

initI2C(false);
// Calibrate the IMU, which removes the accelerometer and gyroscope offsets
myOtos.calibrateImu();
// Set the desired units meters for linear, and radians for angular.
myOtos.setLinearUnit(kSfeOtosLinearUnitMeters);
myOtos.setAngularUnit(kSfeOtosAngularUnitRadians);
// Reset the tracking algorithm - this resets the position to the origin,
// but can also be used to recover from some rare tracking errors
myOtos.resetTracking();

while (true) {

    sfe_otos_pose2d_t pos;
    myOtos.getPosition(pos);

    printf("x: %.2f m, y: %.2f m, h: %.2f rad \n", pos.x, pos.y, pos.h);

}

Credits and Contributions

Original Developer:

   SparkFun :
     Links :

License

The modifications made to SparkFun's work are licensed under the BSD 3-Clause License.

paa5160e1_pico_library's People

Contributors

robotcopper avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.