Giter VIP home page Giter VIP logo

libberryimu's Introduction

Lib BerryIMU

Lib BerryIMU is a C library that acts as a simple, intuitive interface between a Jetson Nano and a BerryIMU from Ozzmaker. It only depends on standard POSIX libraries; all other dependencies are contained and maintained in this Git repository through submodules.

Please note that this library is a WORK IN PROGRESS and is undergoing many changes in content and structure.

Table of Contents

Features

The library currently supports the following module:

GPS

  • Model: u-blox CAM-M8
  • Found in: the BerryGPS line of products
  • Connection type: UART
    • Default baud rate: 9600
    • Parity: none
    • Stop bits: 1
    • Default data bits: 8
  • API:
    • berryIMU_GPS_init(): Initializes the system's connection to the GPS.
    • berryIMU_GPS_update(): Reads and parses the data from the GPS through its UART connection.
    • berryIMU_GPS_destroy(): Deinitializes the system's connection wtih the GPS module
    • berryIMU_GPS_current_coordinates(): Retrieves the most recent measured GPS coordinates in latitude and longitude. (not implemented yet)

Future projects

In future versions of this library, there will be support for these modules:

Accelerometer

  • Model: LSM6DSL
  • Found in: BerryIMU v3
  • Connection type: I2C
    • Default address: 0x6A

Gyrometer

  • Model: LSM6DSL
  • Found in: BerryIMU v3
  • Connection type: I2C
    • Default address: 0x6A

Magnetometer

  • Model: LIS3MDL
  • Found in: BerryIMU v3
  • Connection type: I2C
    • Default address: 0x1C

Barometer/Altimeter

  • Model: BM388
  • Found in: BerryIMU v3
  • Connection type: I2C
    • Default address: 0x77

Thermometer

I'm guessing on these specs; I'm not sure if the BM388 has a temperature sensor at the moment

  • Model: BM388
  • Found in: BerryIMU v3
  • Connection type: I2C
    • Default address: 0x77

Raspberry Pi Support

I think this library could be useful for Raspberry Pi users. Unfortunately, I don't have a new Raspberry Pi to test this library on, so I haven't made an effort to try and write code that may or may not work.

For more information, please refer to the corresponding issue.

Installing the Library

CMake makes it easy to install C libraries. I'm not sure how that process works though.

To use the library, just copy it (and all submodules!) into a subfolder of your project, and in your root-level CMakeLists.txt file, add something like add_subdirectory(path_to_this_folder) and a new library called berryimu can be linked with your project. (For examples, see this repository).

Licensing

The contents of this repository are released under the MIT license.

Reference

The contents of this repository are heavily based on the official Ozzmaker instructions on ozzmaker.com and their corresponding Git repository.

Contrubuting

  • As always, the issues tab is open for bugs and feature requests. No relevant issue is a bad issue!
  • Pull requests are welcome and will very likely be accepted, especially for tasks marked "Future Projects," solutions to issues, and interfaces to new parts (even ones that aren't necessarily on the BerryIMU). My only asks are:
    • No syntax errors
    • All public headers belong in include/
    • All private headers and implemetation code belong in src/
    • Functionality for new sensors (like a new accelerometer part) are placed in a new folder whose name matches the part number.
    • All public-facing functions for sensors begin with the part number of that sensor (to avoid naming conflicts)
    • Feel free to make your own API. If you do, please document it so that others know how to use it!
  • I'll especially need testing help from people with the Raspberry Pi 2, 3, and 4 and the BerryIMU v2 and v4 because I don't have any of these devices.

libberryimu's People

Contributors

m516 avatar

Watchers

 avatar  avatar

Forkers

orb1t-ua

libberryimu's Issues

Raspberry Pi Support

Problem
This project is intended for use on the Jetson Nano and hasn't been tested on the Raspberry Pi. It will not function correctly on a Raspberry Pi due to the following limitations:

  • GPS data access points: The Jetson Nano's UART port is at /dev/ttyTHS1, while the Raspberry Pi's is at /dev/serial0 (I think, haven't verified yet), so the location of the UART can't be hard-coded. Right now, that location is hard-coded at /dev/ttyTHS1.

Solution
One potential fix is to:

  • Write a CMake script that checks if the hardware is a Raspberry Pi and makes compiler definitions accordingly. For example, if the script is running on a Raspberry Pi, it could define the RASPBERRY_PI compiler macro.
  • Create a header file containing all hardware configurations. For example, it could contain the following code:
//------------ Raspberry Pi
#ifdef RASPBERRY_PI
#define GPS_UART_PORT "/dev/serial0"
#endif
//-------------------------

//------------ Jetson Nano
#ifdef JETSON_NANO
#define GPS_UART_PORT "/dev/ttyTHS1"
#endif
//-------------------------

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.